protecting a sensor component from high spikes when switching power on
As mentioned in my comment, it feels like guessing what is happening and trying to counter that. Here is a concept to prevent power spikes from getting to the sensor:







simulate this circuit &ndash; Schematic created using CircuitLab

D1 and D2 should be Schottky type, eg BAT43.