A few weeks ago, I bought a used 2010 Prius IV with 60K miles. It includes the solar panel/moonroof package. It's in beautiful condition and ran great until yesterday. It was a hot day, so when I parked the car I lowered all four windows an inch or so before locking it, just to give it a little ventilation. The car emitted a long beep when I did this, so it was apparent that it didn't like something I'd done, but the beep stopped after about 30 seconds. Three hours later, I returned to the car to find the battery dead, and I had to call for a jump start to get it going, after which it ran fine. Am I not supposed to have the windows open when I lock it? And what could run the battery down if I do so?
You probably were in IG-ON and so the car was on (but not in READY Mode) until the battery died. The long beep when you attempted to lock the door meant the car was on in some fashion. Also, if you have the solar panel ventilation system, that's what it's doing - venting out the hot air. You don't need to lower the windows.
Any long beep when opening/closing doors should not be ignored. Always investigate before leaving the vehicle. There will always be some warning message on the dash display giving the reason the car is complaining like that. To your specific questions: It's okay to leave the windows open when locking the car. In Gen 4, this will give a short beep and a warning message on the dash just to make sure that is what you intended. Simply leaving the windows down will not run down the 12V battery. As was already said, you must have left the car in Accessory Mode (ON but not READY).
congrats and welcome! agree with both of the above. consider testing and/or replacing the 12 volt battery before you have another no start.
Hopefully the car also included the owners manual as you need to read about the wonderful features of the solar roof and how it works. As the saying goes, "You're doing it wrong!". A long beep is a warning; usually for leaving something on that shouldn't be like lights, the ignition, etc.
Did you have anything plugged into the cigarette lighter or 12v accessory plug? While the Prius will cut power to those when the car is turned off, if the accessory has a battery and lacks a blocking diode, it can cause electricity back flow to the Prius electronics, hence the long beep telling you that something is amiss. Check out this very interesting thread, starting with post #12 and thereafter: What is Prius trying to tell me with all this beeping? | PriusChat
I've gotten that beep when I have existed the car but left my keys in it, OR when I had my keys but my wife's keys were left in it. Just one thing to check.