Strange cuda behavior after gstreamer has been updated

I have a project working with Cuda to run neural networks. Also i use gstreamer pipelines using nvh264dec block there. My working environment was - cuda11.4 based docker image with gstreamer 1.20.0 + plugins installed there.
Now i’m trying to migrate to gstreamer 1.22.0. But first of my detection modules fails with CUDA_INVALID_CONTEXT error. Others start successfully. I see that nvinfer1::ICudaEngine object of the first module returns nullptr from createExecutionContext call.

Could anyone help me with that problem?

P.S. I noticed that gst-launch of my pipeline used cudacontext0 in version 1.20.0 but in 1.22.0 it uses cudacontext1.