If it was me, I'd use JB weld. Suitable for use on crankcases, sets rock hard, good for 300 degrees. Key the surfaces, degrease and make sure the centre of the component is fully but thinly covered. looks like its probably a hall effect sensor.
Q bond is good for repairing stuff like that, I use it quite a lot, it works quite well for rebuilding broken plastic bits. heat resistant to 180 deg C so hot oven type temps !