I’ve made a gadget which should (hopefully) free units which get stuck in terrain, features, etc. In the few tests I made, it worked.
It works by detecting units which have move orders, but are not moving (there are a few more checks to exclude morphing/transported units). Such units are then ‘teleported’ to nearest valid spot. There is a maximum range at which such spots can be detected, so it can’t get units out of the middle of the sea for example (but then how could they get there?)
Gadget is included in development version.