The 0g segment doesn't last for long, others above describe it as between 30 and 60 seconds. So when you see video of the weightless conditions inside (the film Apollo 13 for example was shot inside the NASA 0g aircraft) it is only for short segments, the film makers then cut them together to make it look like longer.
It's similar to all those photographs of effortless relative (formation) work by skydivers, they always are shot at about 6,000 feet. Jump from the plane at 12,000 feet, it takes half the descent to get into position, the cameraman has just a few seconds to get their shot, then it's all break apart again to deploy canopies. But all you are shown is those few stable seconds.