Is it possible that the invention patent was stolen by the agent when it was handed over to the agency for application?

First of all, the agent needs to abide by professional ethics. If what you said can happen, it will be a violation of the law for the agent, which may lead to serious imprisonment. If you really steal your patent, the examiner will search it in the examination of the invention application. If someone steals your patent, it will be searched out to deny the patentability of your patent application, so you will know.

If you are worried, don't look for a patent agency. You can apply by yourself. There is no restriction on this by the state.

This society needs division of labor and cooperation. How to inspect and find suitable partners is also a basic skill. Not only patent application, business cooperation technology research and development, etc., all things may have similar situations, but we must measure the possibility of real occurrence. If everything is thinking that the worst will happen, then don't do anything.