Are you aware that NATO expansion into Ukraine seemed very likely at the time of Russia's invasion?
Actually it was effectively impossible, as NATO's bylaws prevent the admission of states with active border conflicts. This is most likely (a large part of) why Putin invaded both Georgia and Ukraine -- to create permanent border conflicts, to prevent them from becoming NATO states.
So in fact there was no imminent possibility of Ukraine becoming a NATO state at the time of the 2022 invasion. Which makes perfect sense, as it was never the reason Putin chose to launch the full-scale invasion, anyway.