This model Mazda BT-50 and its Ford Ranger counterpart (they’re the same vehicle under the skin) have had their share of automatic transmission problems over the years. There are known problems with the gears in the oil pump which are prone to wear, valve-body problems and a fault with the output shaft speed sensor which can also fail, forcing the gearbox back into first gear at relatively high speeds. All these problems could be contributing factors in the problems you’re seeing.
While EGR valves often need replacement (and I’m not disputing that yours did) I don’t imagine the EGR valve would have had anything to do with your gearbox problem. It’s not uncommon – nor unreasonable - for workshops to charge a diagnosis fee (it involves workshop time, after all) but servicing the transmission alone won’t fix it if it has any of the problems I’ve listed above.