I don't mean to be blunt, but to make point that you have a specialty car, and it requires sophistication in all things. Thus, it is no use to worry about what your code generator says, it's most likely incorrect of the true fault that is occurring.
You just got this vehicle, so what you need to do it take in for total update servicing. You don't know it's history or how long it's been sitting without updates.
Things to have done, and it will I suggest planning to put 5k into it.
Oil, check and replace any faulty water pumps as there are 4, air filters there are also 4, spark plugs, check and replace thermostate, flush entire cooling system including battery cooling system, make sure any BMW campaigns have been done for updates, check hybrid module and or replace, check throttle bodies abd replace if needed.
When I got mine, I did all these things. I had a check engine light and a cooling warning on start up. It was throttle body faulting and took a while to find. I have replaced a watew pump twice. But now all is perfect. Just have to take car of this vehicle and it will do you well. Also have bmw run it through the injector cleaner fuel service too, not additive you buy b UT have them un hook vehicle fuel system and run it on thier cleaner system.
Take car of this car. It's amazing. And always maintain it with bmw service.