This is the prime reason why GAs are hesitant to upgrade before the 30 minute mark. I have no idea what actually happened but the counter agent might have already sold the F seat, while you were getting your upgrade and when the transaction was completed, the overbooking was discovered and since a full fare paid F seat trumps the Elite upgrade, you were downgraded because you were the last to be upgraded.
Overbooking of F isn't a common practice but it does happen from time to time. Often times it has to do with a canceled reservation, that must be honored or a substitute aircraft with less seats or someone has "forced" the issue to accomediate a full fare F ticket knowing that an upgraded customer can and might be downgraded with compensation and hoping that someone fails to checkin and/or board.