Check the power wire going from the battery to the key switch, you’ll be looking for a frayed wire causing a short. If you need more help post the engine and units model and serial numbers, so we have a idea of what you are worked no on. Remember, we are not standing beside you and our vision from this far away is very blurry. Help us help you.
Go to mtd.com/parts and type in your model number. You should be able to find the wiring diagram under the photos and features. This should help you find a short. I agree, there is NO way for the lights to be on it you disconnected the battery. From experience, when troubleshooting electrical problems, NEVER ASSUME ANYTHING. From your posts, I have a feeling that you may be going a little too fast, to solve the problem. Double check what you have told us so far and please post the engine numbers as I asked before. I’m not standing next to you, so everything helps me compose a better picture of what you are looking at.
Didn't connect something incorrectly when you replaced the solenoid, or install the battery connections reversed. Other than that wonder would have to be a short someplace in the wiring.