Just to be accurate, we have no idea how long Picard commanded the Stargazer
. Might have been 22 years (which sounds like severe career stagnation), might have been more like three.
The 22-year reference was part of the original character concept and mentioned in the writers' guide, but the reference never made it into any episode or movie. Basically, from the episodes we only know that the Stargazer
was Picard's first command, and also that Picard commanded the ship at the time of her loss in 2354, and we have no info on other commands of his before the E-D.
This allows for all sorts of interpretations, including one or more ships under his command between the known two ones; one or more ships under his command between putative two periods commanding the Stargazer
; all sorts of other commands that did not involve starships and therefore might not have been a consideration when Picard claimed to Scotty that the Stargazer
was his first command; and a host of exotic ideas about secret commands, temporary retirements and whatnot.
One would think Picard would need to spend a lot of time away from the isolation of starships and mingling with important people in order to secure command of the "Federation flagship". On the other hand, his association with Adm. Nechayev and the fact that he was the extremely unlikely candidate picked for a special ops mission in "Chain of Command" might suggest a cloak-and-dagger line of work during the "missing years".