I would suppose it is not necessary - except you require a certain safety level for your application.
In that case, I would consider a MCU tailored for safety application, like the automotive industry often uses.
My company has an older ECU design (which now fell out of favour ...) which does a regular codespace check at runtime, and an emulation of safe storage for critical data. The latter are stored at double size, one value normal and one value inverted. If both do not add up, the ECU throws an error.
For your RAM test: First, I would use the bus width for check item size, i.e. 32 bit for internal SRAM (not 0xFF, but 0xFFFFFFFF). Second, you would need it in your startup code, before initialisation, and constant values are copied in. And including the stack space will have catastrophic results ...
IMHO it would make sense for external RAM. Almost all modern Cortex M MCUs have ECC-checked SRAM.