Ok, so is this doing the flip correctly?
var sprite = get_node("CollisionShape2D/PlayerSprite")
Don't place your sprite under the collision shape. The reason is, collision shapes no longer exist when the game is exported. It also creates a parent/child relationship that you could easily get rid of. So instead, you could have this hierarchy: