It’s probably been in development for a decent number of years. By the time they invaded Ukraine, it may have been more difficult to cancel it if 99% of such a big mission was complete.
Plus, Russia (with China as a partner) is looking to assert its dominance in space once again. If their partners are willing to throw in $$$, Russia will prove they are worthy of such a task & capable of providing rockets that can achieve escape velocity.