You might have ground after all
First, if your wiring is in conduit (loose wires in pipe, writing on individual wires) then the white wire in the switch box is incorrect and should have been a legal hot color. Hot on a white wire is only allowed in cable (several conductors wrapped in a sheath). When the white wire is used this way, it must be "always-hot" (hot at all times) not the switch leg. If it was the switch leg, then both wires to the lamp would be white, and that's confusing and illegal because it invites dangerous miswiring of the lamp (socket shell hot, so you get nailed when changing a bulb - not good). Also, more recent Code requires it be marked with black tape to indicate its use as a hot wire.
Certain conduit types, and certain cable types (e.g. AC/MC) provide ground via the metal pipe or metal cable jacket, and don't actually have a ground wire. If that's the case, the junction box would also be metal. You could test for this by measuring voltage between hot and ground; if it's solid 120V that may well be the case. If it's a waffly 18V, 76V or 109V, that's just phantom voltage due to limitations of cheap DVMs, and should be ignored.
Certain dimmers and smart switches are designed and approved to use ground instead of neutral. These have a bare ground and a green "neutral if available; otherwise ground" wire. You would need to buy one of those. A green wire would need to be attached to the metal box via a #10-32 screw - there should be a pre-tapped hole in the back of the box. If not, use a ground clip. A bare wire doesn't need to be attached to anything, as the switch will automagically pick up ground via its mounting screws. (receptacles marked "Self-Grounding" can do this too).
Otherwise, replace the cable between lamp and switch
with /3 +ground cable. And that's that. You don't really have any other options due to the obsolescence of the cable.
You have an alternative, and that's to bring power (hot, neutral and ground) from some other location to that switch. Then the switch can be wired "conventionally" (non-switch-loop) using the existing switch-lamp cable.
Obviously you bought a product with no prior knowledge of the state of the wall wiring. Unfortunately that purchasing method does not work.
You need to install equipment according to its instructions.
That's not a suggestion, that's a Code requirement: NEC 110.3(B). The instructions did not tell you to cap off the neutral and ground. As such, doing that was improper even if it had worked. Don't even bother trying stuff like that.
You will find dimmers that use neither neutral nor ground. You probably will not find smart switches. However they require at least 1 lamp to be incandescent, or a bypass capacitor such as the LUT-MLC, or particular models of LED that functionally have a LUT-MLC built into them.