[^nobody, it works in master] fix psi seeming invalid during stub-ast switch
(cherry picked from commit f4b3825)