I seem to remember a kit that replaces the detent balls in the internal shift shaft. IIRC, the trans must be removed to install the kit. The purpose is to replace the detents that have become worn, and tend to jamb.
Looked in the TIS, but could not find such a kit.
Ed in San Jose '97 540i 6 speed aspensilber over aubergine leather. Build date 3/97. Golden Gate Chapter BMW CCA Nr 62319.