I didn’t look at your code, but yes it’s generally possible to use JuMP for collocation. Did something go wrong with your formulation? It would help to describe a specific issue you encountered.
There is an example of rocket control in the JuMP documentation. Perhaps hard to find since it’s buried under “nonlinear.”
InfiniteOpt.jl is a wrapper for JuMP that makes such problems easy to deal with. In my experience it’s great. There are several others I’m less familiar with, e.g. OptimalControl.jl.