Revit Versions when 2 sessions open

Hi there
I have some code written for pyRevit that is essentially for a button that when clicked, opens a project file with our door families contained.
However in some instances I may have 2022 and 2023 versions of Revit open at the same time and if I click the button in Revit 2022 it tries to open and upgrade the file in 2023.
Can anyone give any tips for this so that the project file doesn’t try to upgrade and stays within it’s associated version?

you can try my application