If you have oil pressure problems with your engine, it could actually be due to several things. Leaving aside exotic faults like a cracked engine block or cylinder heads.
Of course, it could also be a defective oil pressure sensor. However, I would always focus on the oil pressure problems first, because they will destroy your engine. The oil pressure sensor is only a display problem.
The most common cause is the sealing ring on the oil pipe at the oil pump. This becomes soft and flat over time, and then the oil pump draws in air. This varies depending on the operating situation, whether the oil is cold and thick or hot and thin.
It could be as well the oil pressure relief valve, which is located on the oil filter housing and whose purpose is to release oil pressure when the oil filter is clogged.
It could, of course, be a worn-out engine and/or a worn-out oil pump.
I also had oil pressure problems and rattling hydraulic tappets at the beginning. I replaced the sealing ring on my oil pipe, which significantly improved the situation. Then, before changing the oil, I poured a liter of diesel into the engine and drove for 20 to 30 km. This dissolved all the carbon deposits, and since then, I've had good oil pressure and no more rattling hydraulic tappets.
If I were you, I would definitely replace the O-ring and the valve; it can be done in one go and isn't that much work.
And before changing the oil, I would pour in a liter of diesel and drive a short distance.
At the same time, you can of course check your oil pressure sensor.