I had a little experience
With a friends rainbow. She had one with the switch on the hose handle…same thing happened to her. Turns out a wire came off a terminal for the switch in the handle. I took the handle apart and had to solder the wire back on the terminal for her. But could be any number of things…best bet is to check with an electrical sensing tester…maybe the plug end is bad, bad cord, a bad connection somewhere. A poor connection on the wire to the hose where it plugs into the canister. Try a different outlet in the house as well. I have an Electrolux model G that does this, I think it’s the switch itself is making poor connection so could be a switch gone bad. Plug the machine in and use the tester from the wall plug all the way along the cord and you should get a hot signal following the electrical route to the switch. Then once at the switch flip it and from that point on you should see a different result with the switch in opposing directions.
Also, do you have a power nozzle? If so hook it up and try the vac with that on it and does that run? if not then likely it’s an electrical connection issue prior to or at the main switch.
Jon