Hi,
Please try this method:
[Gstreamer] stream drops a lot of frames after some hours later only with JVC camera - #10 by DaneLLL
If the h265 stream is valid and can be well decoded while using software decoder. And confirm hardware decoder cannot decode it well, please attach the stream so that we can check.