The question was: “The concept of undefined behaviour specific to C/C++ has always seemed batshit insane to me”.
I was explaining why undefined behavior as a concept is a very sensible idea. Whether the expansive interpretation of the optimizations you are allowed to do when encountering the “impossible” are reasonable is a different question.
The part that is batshit insane is precisely that it makes the entire program impossible to reason about.
If UB meant what you described, it would be sensible, but it doesn't, and it's not.
Hence the 'specific to C/C++' part of that sentence. 'Undefined behaviour' is a probably unavoidable part of programming language design. The way that C/C++ interpret/handle it is batshit insane.