First, I'd double-check my VIIN (look at the MFG label on the driver's door jamb or other VIN locations: windshield-lower dash, right strut tower in engine bay, behind the rear license plate, etc)...then check the paperwork from the dealer to make sure the correct VIN was used to order the key (mistakes in data entry can happen). There is a reason why some ALPHA characters are NOT used in the last 7 digits (the "serial number" part) of the VINs on vehicles for the USA market (I,O,Q,U,Z for example)...and that's because they can be confused with numerical digits or other alpha characters.
Do you have any lubricant or penetrating oil with a small straw that you can insert inito your drivers door lock cylinder? If the lock isn't used manually, it may just need some lubrication.
Also try to methodically work the door lock cylinder...perhaps adjusting the depth of insertion etc.
BTW, is this a right hand or left hand drive X5 (I forget which side of the road they drive on in your country)...but for us LHD folks...the image below shows the electronic & manual lock/unlock positions:
(my "go to" lubricant for keeping my door lock cylinders lubricated and maintained is Tri-Flow...it contains TEFLON which helps prevent dust & grime from building up and turning into hardened crud...as well as helps to prevent two surfaces from binding)...and helps water to run off any surfaces that have been coated)