Plastic boxes don’t need earthing, is the wall not solid brick? If the wall is plasterboard the dimmer switch will have a plastic dry lining box, however there should be a earth wire or wires in there, as the new switch is metallic the switch will need earthing the new switch will have a terminal for this.
If you’re referring to the supply for the driver and using a plastic pattress box and plastic blanking plate then neither of these or the driver need an earth, the driver is double insulated, the square inside a square symbol. The redundant light cable coming out of the wall may or may not have an earth wire and if it has then my gut feeling is it’s not connected to earth at the other end of the cable. Where the existing undercabinet lights florescent strip lights?
If the wall is solid brick then any flush mounted sockets or switches will have a sunken back box that’s metallic and will need an earth and any switch that’s metallic will need an earth. Any socket plastic or metallic needs an earth because anything you plug in may need an earth. Rule of thumb if all is plastic it does not need an earth unless it’s a socket if any part is metallic it nees an earth.
Daughters motability car Hyundai Tucson Ultimate self charging hybrid Serenity White Moss Grey interior.
My car SEAT Ibiza SE Tec 1.2 petrol TSI 2017.