That seems like a recipe for disaster. He could just as easily have his vehicle stuck inside the garage. I can't imagine that is up to code.
Or parent sees garage door open and decides to close it. Child is inside playing. Testing starts child is stuck.
Take your pick of scenarios. Neither require a car to be inside.