I believe[1] this isn't necessarily about broken files. There is a
lot of variation allowed by the spec. One example that I've seen in the wild is extra-long (> 60 seconds) periods between I-frames. Seeking to an arbitrary point either requires searching backwards from the seek-point for an I-frame and storing a
massive amount of RAM. As this usually isn't possible and would require decoding
hundreds of frames, decoding may cheat and make do with as many P and B frames as it can handle.
[1] I haven't actually read most of the h.265 spec. It's possible these are technically invalid files.