That's interesting. In normal Ebike wiring with the panel you have, the power comes from the battery to the panel, goes through the switch and then back to the controller. With the switch off, the controller has no power. The brake sensors, pedal sensor and throttle would be inactive because they only get power when the controller is on.
The conclusion must be that there's a short circuit on the 36v wire that runs from the battery to the panel and back . For the throttle to jump to maximum, there must also be a short between the signal wire and either the 36v or the 5v wires. This implies water in a multi-pin connector. The place to look for that is in the wiring manifold in front of the steering head if it's the type that can be opened to expose the connectors, or in the multipin connector near the controller. You have to follow the thick cable from the manifold down to the controller, which sits in a compartment under the battery. The connector will be in that compartment or underneath it. It's also worth opening the compartment to see if water has come in.
I've known other bikes have faulty wiring harnesses that cause all sorts of nasty problems. If you don't find water anywhere, it might be worth a call to Freego, who would about these sort of things, so it might be worth a call to them and hope that they don't just say "take it to a dealer".