Marx's Law of Value is for commodities, ie it cares more about averages of relatively equivalent commodities. The "mud pie" argument and other forms of LTV takedowns apply to Adam Smith's LTV, not Marx's Law of Value.
A burnt pie is a failed commodity. It isn't socially necessary unless there's a market for burnt pies, in which case it would be worth the average time necessary for said society to create a burnt pie, of course taking into account value from Constant and Variable Capital (constant Capital being things like tool usage, variable Capital being things like labor power).