You have to wonder if the situation has arisen in view of possible future claim should a battery related issue occur?
I am sure thats exactly what the dealer did, avoided a future claim - with no actual investigation of the real problem.
Scratches to a cover and distortion of that cover might be argued to have been the cause of any possible battery issues (dare I mention a fire caused by damage to a part of the battery) whilst rather unlikely that an ICE engine had to be replaced because of a scratched and dented sump.
This is my point - you wouldn't replace a whole engine because of a damaged sump, and certainly not because the sump guard was damaged, without looking to see what _actual_ damage had been caused (which is what happened here).
Whatever the reasons you can't help but feel sorry for the customer but safety and functionality issues related to a battery can't be compared with a dent in the sump of an ICE engine.
I think there are parallels to be drawn. Both the engine and battery pack are modular. Both are covered with some protection. If the protection is damaged, the obvious and sensible thing to do is look to see if the damage is of the protection cover only, or the all or part of the item it is protecting. If the modular part is damaged, that can then be replaced.
Here - in ICE terms - what has happened is the sump cover is damaged, and the dealership has declared the engine dangerous because of potential damage to the engine caused by damage to the sump (eg loss of oil pressure or actual oil, or physical damage to the lower parts of the engine) without ever actually examining the sump or engine for damage.
If an examination were carried out, and say the sump was dented, but the rest of the engine intact - you would replace the sump - not the whole engine. The same applies to the battery pack. If the battery pack outer casing, were damaged, but the cells fine, you would replace the case. If one or two cells were damaged, you may replace those.
Battery packs are large complex _modular_ systems in their own right (much like a modern ICE) and like an ICE have large numbers of sensors embedded to keep track of the status of the different components. These are not normally accessible to the user, but with an ODB reader and the right software - all sorts of information is available.
Discarding the entire pack because the protection (not the casing, or cells, but protection) is damaged, without looking any further is ridiculous.