As Lawnmowerman reminds us, the oil tank is rubber mounted, so unlikely to provide a suitable earth for the switch. Must admit I hadn't considered that.
Another issue arises, though - what material is the ball's cup made of? If it's PTFE, that's fine, but if nylon there could be an issue due to oil temperature. PTFE has a max working temp of 250 deg C, nylon around 110. That's not important for most of us, but remember both I and another forum member had very high oil temperatures on the first run after a rebuild. In my case the tank was far too hot to touch, sufficiently so that I was concerned about the paint on it. Was it over 100 deg? Maybe, but I didn't think to put my IR thermometer on it. Certainly would have been in the risky area for nylon, albeit only for the first ten miles or so.