Go back through the track and see when it happened. It usually happens to me on and over-banked curve down and half corkscrew.
go up half a corkscrew, that usually work.
Take the bottom track, delete a section. Maybe you'll need to remove two. Then put in a single shallow 'up', and back to level. Or delete a few sections, on the lower track, and see if auto-complete, (the track arrow with stars on, in the track selector) will finish it for you.
If you use a different trackpart like in the hershey stormtrooper, always make a second one so you are back on the normal coasterlevels.
Don't use half-corkscrews. Then it won't ever happen.