As has been explained. There is no physical oil level sensor as such. The recommendation is to fill the car till it's a couple of mm below max on the oil for the technicians, that way when the diesel gets into the oil the level shouldn't go above max and cause issues. Once the ecu calculates that the oil is degraded enough to need changing it will tell the driver via a message on the display.
There are a number of reasons why the issue the OP has could happen and I stress that I'm not accusing anyone or insinuating that this is what happened..... just throwing some ideas out there which could apply to this fault should it occur to anyone
The oil could have been overfilled by the technician doing the oil change or by the owner when topping up.
The driver could have ignored the warning and kept on going
There are probably a couple of other situations but my brain hasn't woken up yet.
I used to spend my days dreaming of ways diesel engines could fail, a runaway was the second highest FMEA score and there had to be multiple levels of detection and containment systems in place. this was on engines used in JCBs and generators. In a passenger car the risk is a level higher because of proximity of driver and the speed that the vehicle can travel.
You just can't rely on one sensor that may not operate with this severity of failure... You need what is called 'first fault safe'.