Ok so I think i figured out a way to fix a broken sensor. This is what I started with:
An extra banjo bolt(MFS400122570) that is used on the same oil line and a broken sensor.
The leftover part of the sensor is 8mm so I bought an M8 "long nut" and used an M8 die to cut new threads on the sensor. I also drilled a 4mm hole through the extra banjo bolt.
Now you just have to weld the nut and bolt together to create a correctly sized adapter for the broken oil sensor. This is how mine ended up.
Installed on the bike and working as intended.