More speculating in absence of detailed symptoms
This sounds like the output shaft from the transfer case to front diff .The splines on the prop shaft can strip . Maybe need a replacement prop shaft . Maybe also the drive cog in transfer case .
Spend a bit of time searching the forum for info and repair info
Salvage yard may be an option for a replacement part .
Cobra transmission have a longer output shaft available . The BMW shaft does not grip enough splines .
Search this link for X5 NV125 transfer case .
BMW X5 - NV125 : Automatic, Standard Transmission and Transfer Case Rebuild Kits, Cobra Transmission Parts 1-800-293-1848