Why do objects following a path have a random drastic rotation?
check your tilt rotation (in your curve) in vertices that you find weird rotation of your object

in curve edit mode:
Alt + t
to clean

Ctrl + t
to "play" with your tilt rotation

you can even do this with all vertices selected or part of them