Usually when people on the left say they're anti-war, they don't literally mean that we should all be pacifists and surrender to any invading force. Usually, they're referring to the senseless wars where we are the aggressor, such as Iraq or Vietnam, which Bernie has consistently railed against. In fact, there's a pretty good argument to be made that arming Ukraine is the anti-war position, since it deters Russia from starting further wars and greatly slows the one they're currently waging.
And frankly, it's absolutely ridiculous to refer to the baby formula crisis as a "larger issue at home." So far, 4,619 Ukrainians have been murdered in the Russo-Ukrainian War, about 10,000 have been injured, and Ukraine's infrastructure has taken damage on a scale that would make even the staunchest of libertarians weep with anger. It's upset the balance of power in Europe, international norms against wars of conquest against foreign countries. The Russians are believed to be driving mobile crematoria around Ukrainian cities to clean the dead civilians off the streets, that's how fucking serious this is. I agree Sanders should probably address this, but AOC sure has and the comparison is beyond reason anyway.