Chosen Solution
How to fix oil indicator to show oil level
For future readers, my A4 B8 had the same issue, it ended up being that the electronic switch in the bonnet catch was sticking and not detecting that the bonnet is opening. A tell-tale sign in that the “hood ajar” icon won’t be on the dash and hitting the latch with a hammer will unstick it. This happens because the car checks if the bonnet has been open before reading the oil level.
May be sensor is the issue or engine’s oil pressure . Also caused the oil lines are blocked by debris . Have you check the oil level with the dipstick ?
does it fail to read all the time or just certain times? the sensor is a thermal level sensor so will struggle to read on an uneven surface or bumpy surface whilst moving or when the oil is too cold. if it is a B8 ea888 engine is doesn’t have a dipstick unless an aftermarket one has been fitted.