That is correct. A variety of things can happen with pokeballs if the charge runs out. Normally pokeballs run on such little electricity, and have so much power stored inside of them they're more likely to short circuit than run out, but on the occasion they do, they can be charged at the pokemon center. Usually they'll expel their occupants as an emergency protocol before getting too drained of power, or if the device senses an imminent malfunction. This way you aren't as likely to run into the danger of losing your pokemon. Actually, one pokemon actually came about from the short circuiting of a pokeball, and this pokemon had explosively electrical properties.
A pleasure to meet you young detective, I am Lance the dragon master.
[video]
A pleasure to meet you young detective, I am Lance the dragon master.