So my (admittedly quite cursory) understanding of history is that by the Middle Ages, the sword was considered a largely ineffective weapon - it was used primarily as a status symbol or a duelling weapon, with longswords still seeing some use for breaking pike formations, etc (though I've read they were wielded more as blunt instruments than edged weapons).
However, I'm also under the impression that a few centuries prior to that, the Gladius was a highly effective weapon that was a large contributing factor to the efficiency of the Roman legions.
So my question is, what happened? What caused the sword to shift away from being the dominant weapon of the battlefield? My guess would be a number of factors, including the shift away from professional armies and the resurgence of pikes, but I'd want to hear from someone who actually knows what they're talking about.
Swords were not uncommon or ineffective in the middle ages. Far from being a "status symbol" or purely for "dueling," they were utilized by both rich and poor troops. Although owning a sword may have been a mark of status for a Carolingian warrior, by the 14th century or perhaps even earlier, low quality swords became cheap enough to be affordable for most soldiers. Swords being merely a sidearm carried for status is one of those persistent pieces of internet mythology that is repeated without any historical basis. Period art shows plenty of soldiers with swords. Textual sources mention swords in combat all the time. Archaeological evidence from sites like the Battle of Towton in the Wars of the Roses would indicate that medieval soldiers were not picky about what tools they used to butcher people. Sword, poleaxe, dagger, etc., wounds are all in abundance.
Side note: I'm not especially well-read in pike-and-shot era warfare, but IIRC, there's no real evidence that longswords were used for "breaking" pike formations. I don't think there's any articles specifically addressing the role of longswordsmen in pike formations. I wouldn't take my personal views as gospel on this subject, but my guess would be that the longswordsman would not be utilized directly in the pike line, but used for things like guarding a commander or a flag, assaulting breaches in the walls of forts, and generally being utilized in situations where a pike would be an unwieldy choice.
The sword was by no means a "largely ineffective weapon." If that was the case, medieval people wouldn't have used them at all, as an impractical weapon would have gotten its user killed. If you ever find yourself thinking that a particular, widely-used weapon was ineffective, it's good to ask yourself "what assumptions might I be making about this weapon that aren't true?"
In general, medieval swords were very versatile weapons. They could be carried around fairly easily (compared to larger weapons like polearms or halberds) and cut and thrust reasonably well. They could also defend fairly well due to the point of balance and guard, especially compared to weapons like maces or axes, which are heavier towards the tip (i.e. harder to move around quickly compared to a sword) and generally don't have guards. In the case of the longsword, they could also be used as a bludgeoning tool or a short spear using half-swording techniques, in which you grip the sword by the blade to make more precise thrusts or to strike with the pommel (the latter of which is a technique known as the "mordhau" or "mordschlag," meaning the "murder stroke"), as shown here.
As for swords being used primarily as expensive status symbols, it depends on the specific period of the Middle Ages. While that may have been (more) true in the Early Middle Ages, by the High/Late Middle Ages (13th-15th century), swords became much more common due to advances in metallurgy that allowed people to produce swords more cheaply with higher-quality steel. Knights and common foot-soldiers alike would often have swords in addition to polearms (like spears and halberds), daggers, and missile weapons (like bows or crossbows). This video from Scholagladiatoria talks a bit more about the value of Medieval swords, though his salient point is that swords became cheaper and more common by the 13th and 14th centuries.
So my (admittedly quite cursory) understanding of history is that by the Middle Ages, the sword was considered a largely ineffective weapon - it was used primarily as a status symbol or a duelling weapon, with longswords still seeing some use for breaking pike formations, etc (though I've read they were wielded more as blunt instruments than edged weapons).
Your timelines are off, as others have mentioned. The devolution of the sword from weapon of the common soldier to status weapon occurred much later, roughly around the 18th Century. The main cause of this was the bayonet, which gave the rank-and-file soldier a backup side-arm that could work as both a short sword, short spear, or both, depending on the type. So the common sword didn't really devolve so much as evolve into a hybrid weapon that was less recognizable as a pure sword.
The pure sword remained in use as an officer's weapon. They were still very useful as weapons, for the same reason that bayonets were: with single-shot firearms you only got one shot at close quarters, and then it was hand-to-hand. Repeating firearms in the late 19th Century further pushed swords toward obsolescence but it was still easy to run out of ammunition, so they remained in use right into WWI.
So when swords are described as a "status" weapon, that doesn't mean they were merely a badge of rank, but rather that they tended to be worn and used by the higher ranks. Duelling, being a pretension of "gentlemen", was also something practised by higher ranks, but neither of those facts mean that swords had no practical use beyond social posturing. The era where swords were worn purely as a status symbol and unlikely to ever be used for their intended purpose did not really arrive until the early 20th Century, with the triumph of automatic firearms and the final collapse of duelling culture.
Just to add to the discussion, it's noteworthy that the gladius was a short sword mostly meant for stabbing. Despite Rome's move from the phalanx to the manipular formation, the manipular formation was really just a hybrid of a phalanx in that the individual manipule still depended on a phalanx like strategy of a shield wall from behind which troops would strike out at the enemy. So while they did use swords, they didn't use them in the same way as, say, a claymore wielding Scotsman. That's not to say they didn't hack or slash with them, but swinging a sword wasn't exactly conducive to a tight formation.
I can't speak to the use of a sword outside of that.
I think its important to remember that the typical arms and armour used by a Roman soldier changed quite a bit over the centuries. By the 3rd C, you see a significant shift towards the longer Spatha. I'd argue that the main change in sword technology happens here, in the late Imperial period. Pretty much the style of blade you see on late spathas would lead directly into the "Germanic" swords of the early medieval. If you are interested I can type up a decent write-up with sources and primary examples that will walk you from the Roman spatha to the first "medieval" cruciform swords. It will take me awhile though, so l et me know if you are interested.