There is not a lot of time between the end of Ragnarok and the start of Infinity War. Despite the gap between movies for us, the timeline seems pretty narrow for the character. It was basically a cascade of events hitting one after the other in rapid succession from Ragnarok through to the first part of Endgame and they all kind of tailed off of one another. They're all part and parcel to fueling his insecurities.
Also, Whedon implied the same thing that Russo said in like 2015. Someone asked him at Q&A thing about why Cap couldn't lift the hammer and his response was “Did he fail? Or did he stop?”