1st thing I tried, was a battery disconnect

sometimes works for a while-would have been good for it to have stood an mot
looks like you have no option but to replace and get it coded in,bit of a headache-very common failure across the bmw range it would seem-another built in earner for them