Yes, for the ledge issue, you might want to look into coyote time. It gives the player a tiny extra window to still perform a normal jump right after walking off a ledge.
That way, if they press jump slightly late, the game can still count it as a jump first instead of immediately switching into flight mode. Flight mode would only activate after that small grace window is over.
(As a bonus, you could also look into input buffering. If used for jumping, it lets the game remember a jump input for a short moment, so the player doesn’t have to press jump at the exact frame they land.
For example, if the player presses jump right before touching the ground, the jump can still trigger once they land instead of being ignored. Combined with coyote time, it can make jumping feel much smoother.)