5th dnd – Can a flying creature avoid fall damage by flying just before the impact?

Tell a creature whose flight speed begins its turn 500 feet above the ground. They stop flying and bow to the ground. 5 feet before the impact, they use 5 feet of their flying motion to reach the ground.

From what I can see, they do not suffer from falling damage as they did not fall when they reached the ground. Does this pose a problem of complying with the written rules?