As has been noted in the comments, this is due to the fact that protrusion is applied to all lines in the verbatim block except the first one (because of some intricacies of the verbatim environment). In principle, you wouldn't want protrusion in verbatim text anyway, so it's the best idea to switch it off there. Ulrike's solution (as well as the one given in the "Hints and caveats" section of the microtype documentation), however, have the disadvantage that they will also affect the preceding paragraph if it's not separated by an empty line.
Therefore, I suggest to add the following after the package has been loaded (and this will also be included in the next release of microtype):
\makeatletter
\MT@define@patch{verbatim}
{\MT@append@patch\@verbatim{\microtypesetup{activate=false}}}{}
\makeatother
\microtypesetup{protrusion=false}
before the environment, as suggested in one of the answers there, or redefine the environment to do that automatically.\AddToHook{env/verbatim/begin}{\microtypesetup{protrusion=false}}