Maybe don't start an animation, and instead advance a spinner when a thing happens, and when an API doesn't come back, the thing doesn't get advanced?
So programmers didn’t like it because it was complex, and designers didn’t like it because the animation was jerky.
As a result, the standard way now is to have an independent animation that you just turn on and off, which means you can’t tell if there’s actually any progress being made. Indeed, in modern MacOS, the wait cursor, aka beach ball, comes up if the program stops telling the system not to show it (that is, if it takes too long to process incoming system events). This is nice because it’s completely automatic, but as a result there’s no difference between showing that the program is busy doing something and that the program is permanently frozen.
Even if you don’t know the actual progress, the spinning cursor still provides useful information, namely “this is normal”.
Edit: Fwiw, I would agree with you if we were discussing progress bars as opposed to spinners. Fake progress bars suck.
Of course, progress bars based on increments have a whole other failure mode, the eternally 99% progress bar…