Russia didn't invade Ukraine "out of the blue". Russia has been at war with Ukraine since 2014, when it occupied and annexed Crimea, and at the same time orchestrated and instigated covert War in Donbas.
You ramble something incoherent about the RAND paper from 2019. Just to clarify this: yes, it is precisely where the defense research should have spent the money following the Russia's aggression.