There is no way to identify "bad" MKVs without trying to play them or running them through ffmpeg. I'm not expert enough to really break down the problem. My understanding is that MKVs have what's called "packet timestamps" in the file. It keeps all the various streams in the video in sync and is used by video players to enable scrubbing/skipping around the video. These "bad" MKVs either don't have them or they're malformed in some way. To remedy this we use "-fflags genpts" to regenerate the packet timestamps (the pts in genpts).
Jellyfin 10.10.3 (Docker)
Ubuntu 24.04 LTS
Intel i3 12100
Intel Arc A380
OS drive - SK Hynix P41 1TB
Storage
3x WD Red Pro 6TB CMR in RAIDZ1 (JF Library)