Since it happens on and off, chances are it is a connection issue. Do me a favor. Look under the vehicle. On the side of the oil pan, you will see the level switch. Disconnect it and inspect the connectors. Make sure they are clean, not damaged or corroded, and the connector fits tightly on the switch.
I attached a pic below showing the switch location. Start with this and let me know what you find.
See pic below.
Thursday, July 21st, 2022 AT 7:34 PM