Right, I've had a look at this in the modding tools.
First, the M2 flamethrower doesn't actually take up any slot space even though it requires an open slot to upgrade. You can grab two Brens/PIATs/Vickers after upgrading.
Are you sure? I thought it was the minesweeper that did not take a slot
Second, you shouldn't be able to upgrade both the minesweeper and flamethrower at the same time. Both upgrades have a specific requirement that the other isn't present. I don't know whether this is a bug or a change that isn't in the tools.
Shouldn't as in can't or shouldn't be able to? I tested this just today.
Third, Royal Engineers only have two upgrade slots. You can have two of the minesweeper, flamethrower or heavy engineer upgrades but not all three. That still doesn't stop you from being able to have a flamethrower, Vickers K, and two Brens/Vickers/PIATs.
Nothing will stop me from upgrading my REs with 2 vickers HMGs! I made the same mistake in my initial post (fixed it now). I've been mixing them up ever since the announcer on the halftrack said 'dropping vickers' when it was really a bren.
Last, you can always have the heavy engineer upgrade except if you have both the minesweeper and flamethrower upgrades.
Evidence that you may have mistaken the flamethrower not taking up space for the minesweeper not taking up space. The minesweeper does not take up a slot so you shouldn't be able to upgrade the flamethrower (I believe) and still get the heavy upgrade since one of them has to be blocking the upgrade.
I'll probably do some in-game testing though.
Thanks for the support!