Sorry to necro this Topic, but I saw multiple of these without (most of them) mentioning how to solve this with Transforms, so I made a guide on this very thing!
Tl;dr, you can achieve stable flipping in the x direction with something like the following on the root node:
if velocity.x > 0:
transform.x = Vector2(1.0, 0.0)
elif velocity.x < 0:
transform.x = Vector2(-1.0, 0.0)
This way, all children should also flip correctly