So there ought to be various gates all over Tamriel that were left intact, including gates within cities. The code was also supposed to have caused all the debris everywhere to vanish as well but that doesn't happen, nobody reported it as a bug, and Bethesda didn't care enough to fix it.
All it did was instruct every gate to run the reverse animation. This was limited by how the scripting works to call their shutdown code though. The end result of this should logically have been a series of gates still standing but with no portal.
When Martin pulls the Akatosh avatar bit at the end of TES4, whatever gates were standing open would have had their dimensional bridge abruptly severed, and I believe that would result in the physical manifestation remaining behind since it was NOT properly shut down. So when those close, they're doing so under a controlled set of conditions and the physical portal withdraws as per whatever designed system the Daedra use for that. Further, the gates that you as the player close down are done via removal of the sigil stone power source. All gates used the same resource file so they all collapse the same way.
'While the gates in TES4 were shown to collapse into their debris piles, the only known reason for why the physical parts vanished is because that's just how the animation was done. They're a part of the 'open cities mod', here's the modder's explanation for the gates (taken from his skyrim nexus page):