I think the way that works is Russia's nominal GDP is circa $2 trillion, of which Russia spent $87 billion on defense in 2022 or roughly 4% of GDP.
That compares to about 3% of US GDP spent on defense and less than 2% by most western style democracies.
But Russia's $87 billion is about 15% of Russia's total government spending in 2022, which was ~35% of GDP or around $700 billion.
And 15% is the number which is said to increase up to 40% or 50%, meaning Russia's defense spending could rise from $87 billion to something like $300 billion, which would be circa 15% of Russia's GDP.
Those Russian numbers are not yet approaching percentages of many countries during the Second World War, however as of today, only one other country in the world spends as much of its GDP on its military.
Ukraine = 34% of GDP spent on its military in 2022.
Factoring in size of economy Ukraine numbers make sense
As to Russias spending I wonder how reduced net revenue from petro sales, loss of military export market, much increased imports , and devaluing of ruble and inflation factor into this?
If I were to guess I would say that military and internal security portion of budget is under estimated, as well as gdp since much of that is built and then blown up. Not exactly long term economic gain there, but I am not an economist, and numbers from Russia like China are always suspect.