Hello XXXXXXX and welcome to JA,
I have been reading on your earlier posts and saw that you had some issues with your keys. So if I understand it right you bought a new key and ad it programmed by a dealer. Did they program your old key too ? Every time they add a key they need to program all the keys available so that they all work. That's why I think they didn't program your old key. Second thing is this. EWS computer is the one who stores the key codes. Every key got a code and the EWS is the computer what verifies the key. If the key isn't programmed in there it won't crank the car. That can be faulty or a bad ground connection. The ews computer is located under the steering wheel on the left.
Other thing which can be bad is the Receiver off the key. It is located around the switch and goes from there to a little box which is located under steering on the right side. There is a possibility that that receiver is going bad on you.
But the only way to really find out what is wrong with is the dealer or a specialist who has a BMW GT 1 scanner or LAUNCH X431 . Dealer charges you around 120 USd and 30 min labor and specialist around 60-80 USD. Who ever programmed your key tell him that you have this issue and they should help you out with this for almost as a warranty. I have a shop and If this happened to you I wouldn't charge anything for scanning your car and telling you what is wrong with it. good luck
BMW Technician
BMW Service Center Specialist.