Russia did not think they’d be engaged in this type of warfare. Putin figured his army would roll in and take over after Zelensky left the country. He figured wrong. In fact, “Russia” is only risking war because Putin is the dictator of Russia.
Putin thought building up a huge reserve of foreign currency and bonds would protect Russia through any economic sanctions. Putin did not understand international banking, the SWIFT system, the effect of Western countries withdrawing from Russia, the vulnerability of the ruble, and the shock to the Russian stock exchange and investment climate.
The risk and resulting war were both much greater than Putin thought.