Weird parsebin behavior on android

Hi!
I’m running a custom version of QGroundcontrol which uses gstreamer 1.18.6 and Qt5. I’m encountering a similar issue as in the linked github page.
The problem is, during pipeline restart (full teardown and recreation) parsebin negotiates inccorect caps when using an RTSP stream. But if the stream is switched to an UDPsrc, everything is fine with it. Or if the application is restarted. Also, pipeline restart works fine when using SW decoder instead of android HW decoder.
Any pointers would be highly appreciated!

Take a look at the two pipelines and GstParseBin.
Related issue Android GStreamer pipeline only starts once at application startup · Issue #11676 · mavlink/qgroundcontrol · GitHub
Related code qgroundcontrol/src/VideoReceiver/GstVideoReceiver.cc at Stable_V4.3 · mavlink/qgroundcontrol · GitHub
Top is working pipeline, bottom is pipeline after being rebuilt.