There’s also the minor quibble that restricting food exports to starve another country are illegal under international law.
That sanctions only harm the civilian economy is not an argument against them. Kinetic sanctions agains oil refining are also primarily impacting the general population and the military have enough oil. But they still impact the ability of the Russians to fund the war. Civilian infrastructure and economic assets are used by militaries too.