There is probably some corrosion on the contacts inside the number plate lamp
Take the plastic cover off and clean up the connections and see if that fixes it.
If the lamp still stays on, take the plastic shroud off the n/s boot hinge and carefully inspect the wires for breakage.
Like the folding mirrors, the hinge is a weak point for wires breaking and shorting out on the metal hinge.
I had 3 break on my last W211.