The reason that BMW didn't have the brake module figured out is because this was their first SUV and was also one of the very first "crossover" SUVs. I don't think anybody making unibody vehicles of any kind had towing very well figured out at that time (1999).
I have one more thing which I can universally recommend: buy a reproduction wiring harness from this ebay seller (
https://www.ebay.com/usr/bahgelsson who is a member here) along with a used towing module. It is easier to get this working than it is to wire up an aftermarket wiring for a towing harness (i.e. no coding required, it is plug-and-play at least for pre-facelift cars). It is also very easy to add a brake controller using the factory setup.
(The harness has been OOP for several years and this is the first reproduction one available. I towed for several years with aftermarket wiring and just got used to the errors on the dash. I can heartily recommend doing it the "right way" with this equipment.)
I don't even have a degree in electrical engineering! I'm just a simple-minded mechanical engineer.