Typically its because the oil pressure switch is broken. It won't show any codes because its a warning, not a fault. If the engine sounds ok then its just a switch issue. They fail often enough for me to replace them as a matter of course when the engine is out.
https://www.amazon.co.uk/gp/product/B00CD5AL72