Flame's End - S1-E13
Other mistake: MacGyver and Amy get locked up in the nuclear disposal chamber with the sludge coming for them. Amy says "before it reaches this room it will get too hot for us to breathe", but just as MacGyver closes the door after managing to get it open, the sludge pours in. At this point they're breathing just fine and not sweating at all.
Answer: Late one night, Geoffrey used a covert listening device to overhear David explaining his barricade device to Janet which is how he figured it out.
How do we know Geoffrey really did use a covert listening device? They didn't mention him using one.
There was a scene of him using it when David told Janet about his barricade.