This question is mainly applicable to beetle's and cockroaches. If I flip them so their legs point upward, they usually squirm around and wiggle trying to come back upright. Sometimes they succeed, and turn right side up again; sometimes they don't. Do insects have any built in mechanisms to unflip themselves.
I was unable to find any sources, but I believe they should, since insects climb stuff, and they may land inverted if they fall, so a mechanism might've been evolved to unflip themselves.

Why don't you consider their attempts to come back upright as a mechanism to do so?I could attempt to fly, although I'd die if I tried, since I have no mechanisms (wings, hollow bones) to fly. – Twisted Genes Aug 03 '17 at 07:10