(Full disclosure: this is a silly question, not to be taken too seriously.)
A Hat of Vermin (XGtE, p. 137) can be used to conjure up to 3 rats:
This hat has 3 charges. While holding the hat, you can use an action to expend 1 of its charges and speak a command word that summons your choice of a bat, a frog, or a rat. The summoned creature magically appears in the hat and tries to get away from you as quickly as possible. The creature is neither friendly nor hostile, and it isn't under your control. It behaves as an ordinary creature of its kind and disappears after 1 hour or when it drops to 0 hit points. The hat regains all expended charges daily at dawn.
Pipes of the Sewers can be used to summon forth a swarm of rats, if enough rats are around:
The pipes have 3 charges. If you play the pipes as an action, you can use a bonus action to expend 1 to 3 charges, calling forth one swarm of rats with each expended charge, provided that enough rats are within half a mile of you to be called in this fashion (as determined by the DM). If there aren't enough rats to form a swarm, the charge is wasted. Called swarms move toward the music by the shortest available route but aren't under your control otherwise. The pipes regain 1d3 expended charges daily at dawn.
Now, imagine the following situation:
An adventurer, in the middle of a rat-less environment (like a desert) but carrying Pipes of the Sewers and no less than EIGHT Hats of Vermin. He promptly decides to spend the next 2 and a half minutes summoning all 24 rats from the Hats. He then plays the Pipes and attempts to use a charge, with the intent of "gathering" the 24 skittering rats into one convenient swarm (I went with 24 rats, because a Swarm has 24 HP, which may or may not represent the amount of individual rats in it; who knows).
Would this needlessly complex chain of events, indeed, allow our Piper to "make" a Swarm? And if so, would it only last an hour?