Make sure your bounding box is correctly shaped (hit f11 two times in a row to check) as this looks like the bounding box is below players feet. For this reason code assumes the player is on the ground even if this wouldn't be the case.