Maybe the hardware decoder just doesn't like iterating through a single video frame over and over again. I looked up online and I found this, maybe this is the key?

https://ottverse.com/how-to-loop-videos-using-ffmpeg-step-by-step-tutorial/