What causes oil to leak from the gearbox in a 2016 Mazda BT-50 3.2 diesel?
First things first: are you sure the leak is coming from the gearbox and not the engine? It can be very hard to discern the difference in a manual car, although it’s easier in an automatic as the transmission fluid is usually a red colour.
Beyond that, oil can escape from a gearbox through a variety of places. The breather could be allowing fluid out, the pan seal could be leaking, the rear gearbox seal could be faulty or you could even have a cracked transmission casing. Don’t rule out a leaking drain plug, either, as this is a very common source of a leak. You might even find the leak is coming from somewhere within the transmission cooler and its plumbing.