Swapping the complete gearbox is almost impossible. What is possible though is to use some of the internals from the 335d (ZF 6HP28) tranny to update some parts in the 335i tranny (ZF 6HP21). No further details yet, but U can try to ask Eugen. Check out
this thread.