This matches what is done on calls, since
cc981d285d (extended for another case in
5a751e747d).
Apply both those cases on invoke just like is done for call.
Also update the preexisting comment which was left without update in
5a751e747d.
This fixes github issue #61941.