But Russia doesn't need to fight those countries. They are hundreds of kilometers away from the Russian border. Ukraine on the other hand is hundreds of meters away. Having Ukraine in NATO or in the EU is a threat to Russia and its leadership today. So Russia will look to poison Ukraine for these 2 organizations and make it an unattractive member.
When EU got too close in 2013-2014 Russia responded in exactly the same way. Both the US and Russia have reacted in the same manner when the enemy tried to reach their borders in any way (via Cuba or via Ukraine). So in 2022 pursuing any relationship particularly between NATO and Ukraine could not have had any other result. It is absolutely inconceivable that this was unexpected given the obviousness, so it's a safe assumption that the goal is to keep Russia fighting and draining the little they have left, with Ukraine paying the (biggest) price. "Buffer" countries always do.