This is the type of grommet used to connect vent pipe and drain line (from toilet or sinks) to the top of waste tanks.......

Your vent pipe was binding because of improper installation. When you removed the vent cap the stress on vent pipe was relieved, unfortunately the other end of pipe jumped out of the tank grommet.
Hopefully you were able to get it back into the grommet.
When you used the screw up at roof line......did you have to push down vent line to position it OR was the stress off of pipe?
I would check it again in couple months after some time traveling to see how it is holding up.