NvEnc With FFMPEG use GPU scaling (scale_npp) : missing closed caption Text

Here I have added caption support and it is working fine with cpu saling but for scale_npp scaling (gpu scaline , hardware scaling) captions texts are not proper in output.

I have debugged something like in decoder that it can not copy every frame to encoder.
In cuvid deoder function “cuvid_handle_picture_display” not getting picture index what already decoded in “cuvid_handle_picture_decode” function call.

Ideally as per decoder flow call back function “cuvid_handle_picture_display” will call after “cuvid_handle_picture_decode” function call.

Here issue is like I am storing caption data in array as per “picparams->CurrPicIdx” (current picture index) received in “cuvid_handle_picture_decode” function and I want same data in function “cuvid_handle_picture_display” .
Index number missing or not getting in function “cuvid_handle_picture_display” to get data back from array.
(Ex, Frame of Picture index 8 in “cuvid_handle_picture_decode” is missing in function call “cuvid_handle_picture_display”).

Does anyone have an idea why the index number can miss in “cuvid_handle_picture_display” or any parameter drop a particular frame?

Or something else we can check to add proper caption support with hardware scaling.