We have metal pipes underground for 10+years. Can't powerwall handle that? Also you probably don't need full enclosure to be metal, can be some corrosion resistant material, and only metal heatsink.
Pipes leak all the time from corrosion or get penetrated by tree roots or get punctured by construction or get damaged in earthquakes.
Lithium batteries do not need external oxygen to burn and toxic smoke coming up from your backyard with no way to reach the source doesn't sound like a fun proposition.
How about corrosion resistant enclosure? And even it will be damaged (probability is probably low) you can have a sensor to detect that and replace the enclosure.
Batteries burning underground should be less a concern compared to them burning on a wood wall of a house.
In case of an incident circuit breaker will turn them off, and batteries will burn themself w/o damaging anything else.
Unless you happen to have a coal seam in your yard or live on a peat bog it's overwhelmingly more likely that it'll run out of fuel before it hurts anything.
People have been digging fire pits (or building up the ground to the same effect) for millennia because it makes fires more controllable.
Lithium batteries do not need external oxygen to burn and toxic smoke coming up from your backyard with no way to reach the source doesn't sound like a fun proposition.