A batter hits the ball really high and runs the bases to home plate. However, one of the defending players catches the ball after the batter crosses home plate and the ball never touches the ground.
Would it be considered a flyout or a home run?
Kad's answer is correct -- any ball that has not touched the ground and is caught, regardless of the runner's position, is out by flyout. However, I wanted to challenge the premise of the question.
This could never happen in any baseball game due to the physics of a flyball. For example, this question has an answer for one of the highest flyballs from the 2019 season by Joey Gallo. That flyball went over 200 feet up and had a hang time of 7.3 seconds. My search results have yielded similar numbers for a top hang time for a flyball -- somewhere between 7 and 8 seconds in the air. I'm no physics major, but even when factoring in spin, altitude, and an exceptionally hard-hit ball -- you aren't going to exceed 10 seconds of hang time on a flyball.
This HuffPost article breaks down the ideal path around the bases and the time required to do so. They conclude that the ideal path would result in a total time of 16.7 seconds to round the bases.
The total time around the bases is about 16.7 seconds assuming maximum acceleration 10 feet per second per second, about 25 percent faster than following the baseline for 22.2 seconds (coming to a full stop at first, second, and third base), and about 6 percent faster than following a circular path for 17.8 seconds.
In fact, they provide the Guinness World Record for the fastest run around the base path.
The record time according to Guiness[sic] is 13.3 seconds, set by Evar Swanson in Columbus, Ohio, in 1932. His average speed around the bases was about 27 feet per second.
So even at world record speed with the maximum height on a fly ball, you would still be unable to complete the run prior to the ball being caught.