In the early days of Rome (kingdom and early republic) large oval shields were used and heavy Roman infantry fought in the manner of hoplites.
Around 300BC the Roman army changed into the form we recognise, adopting changing from phalanxes to a manipular structure.
The Roman heavy infantry adopted the scutum.
Oddly enough by the 3rd century
AD oval shields had come back into use.
I don't believe the Testudo formation dictated what shields were used by Roman infantry.
It was a very specialised formation with many weaknesses.
Given the Roman track record of innovation and their doctrine of tactical flexibility it seems unlikely that their shield choice would be beholden to one of the many tricks in their vast playbook.
The whole idea of their early abandonment of the phalanx in favour of a manipular structure, which coincided with a change of shield, was to increase this flexibility.
There is evidence from Polybius 1 that the shield was adapted from a oval to rectangular shield used by the Samnites (one of their early Italic rivals), so it must have had real combat advantages outside of the Testudo.
Why did the oval/rectangular shield lose its appeal then?
There was another change to Roman infantry equipment that happened during the late 2nd and early 3rd century.
The sword in general use changed from the short Gladius to the longer Spatha .
A longer weapon would have changed the ergonomics and tactics of combat, leading to a change in shield type.
The Spatha was a more "cut and thrust" weapon and was used as an auxilary type weapon in the 1st century and was also adopted into Germanic use.
This was about the time of the loss of a professional core after the Constitutio Antoniniana and the removal of the elite legions' special equipment and status.
It seems reasonable to say that Roman infantry adopting auxiliary-style weapons (this shield and obviously auxiliary-style sword) was part of this process of the Roman army becoming dominated by the equipment and tactics of the Auxiliaries.
1
: it's all behind paywalls of couse: Polybius
(VI, 23 2-3),
history.stackexchange.com/users/1633/Nathan Cooper
Permanently fell out of use you say?As soon as one needs the same tactics, one needs the same design of shieldsand a similar kind of training.
Here Kyrgyzstan riot police doing what they call a "turtle" with rectangular shields: and those are Venezuelans doing the same:
Now compare that to the classical depiction of roman "testudo formation".
history.stackexchange.com/users/904/horsh
To answer the original question, I believe the Scutum did not completely fall out of use until the fall of the empire its self.
Throughout the centuries of use, both 'core' heavy infantry Legionaries AND the Auxiliaries used oval shields of various sizes.
A comment above noted the move away from the short stabbing Gladius, in favour of the longer Spatha, this was undoutably easier to wield with a lighter, more easily manouvered shield.
However, when it comes down to it, the Scutum was a tool used by highly trained heavy infantry fighting in line based formations.
Training included how to "punch" with it, how to run at the charge with it, and how to manoeuvre with it.
With the decline of the empire, the reduced standing of the Legions, and perhaps a reduced emphasis on training, plus the ease of use and construction of the "old style" oval shield brought about its decline.
Certainly the Vikings, Angles, Saxons, Franks and other western European successors to the empire often still fought in line, with various round, oval and kite shaped shields, but with thrusting spears, pikes and even long hafted war axes, cut and thrust swords longer than the Gladius being a symbol of a wealthy warrior, so without the short stabbing sword no Scutum ?
history.stackexchange.com/users/3158/user3158
The Scutum was too expensive as was the Lorica Segmentata, and the training of the Legionnaires.
And as was said prior Roman Citizens didn't really want to die in a foreign land
and so Rome had to rely more upon Auxiliaries and Foederati as well as Sagittari, and many others.
Rome became lazy in the basic sense and the Barbarians saw good pay and protection for their families and their tribes who were allowed to settle in Roman boarders for their services.
The Scutum was made of 3 pieces of wood wrapped in leather with cast iron on the edges and in the center.
The Shield they used later was only 1 piece of wood with cast iron on the edges and center, much like that of the barbarians who fought for Rome.
Rome also got rid of the Pila and replaced it with s Plumbart or Lead Dart
it all was because Legionnaires, Scutums, Gladius, Lorica Segmentata, and Pila were costly but effective .
Later Emperor's didn't care about effectiveness, and believed that because they were Rome they were the best military conquerors of many nations.
So came the Comitanses, Spatha, Round Shields, Lorica Hamata, and Plumbart.
Cheaper, but not as effective .
history.stackexchange.com/users/6730/Glory of Rome
There is no way the shield had cast iron.
It would have been forged out and hammered into strips.
Cast iron is brittle.
Now, the scutum was curved so that a man's body fit snugly into it in combat lines where they could "push" as a phalanx "pushed" but the scutum would have been far safer during the "push" as it offered leg protection and facial protection whereas the greek shield was big and round or tombstone shaped but flat.
Flat shields can be turned by barbarian hands gripping them and because the scutum was cylindrical the soldier could apply some measure of torque to keep the shield from being pulled especially if he was tucked in.
In much the same way if a barbarian was to try to pull the shield down by pulling it outward, the roman soldier could brace it with his knees at the bottom or set it down and use the ground and feet to brace it.
The scutum was advanced weaponry.
history.stackexchange.com/users/22883/peter barosso
The Scutum was discontinued because around the 3rd century AD the Roman Legions were mostly made up of Auxilia.
This created more "barbarian" influence in the Legions.
Eventually the Roman Legionary began to look more like a Germanic warrior instead of what most people think of when they hear the term Roman soldier.
history.stackexchange.com/users/12649/user12649
Wikipedia says   By the end of the 3rd century the rectangular scutum seems to have  disappeared.   Why did the rectangular  scutum  design fall out of use? Why was the shield design not commonly used by anyone else later in history?
Why did the scutum fall out of use?
history.stackexchange.com
<military><ancient-rome>
history.stackexchange.com/questions/8389
history.stackexchange.com/users/2140/Aaron Kurtzhals
The development of longer wepons meant the need for a new shield. The scutum was also expensive to make and there was less emphasis on training around this time. There are number of possible factors involved, however one likely key factor was that the shield was expensive to manufacture. Additionally, the decline of the Roman Empire and the emergence of new weapons and styles of combat may have necessitated a different style of shield.
The emergence of a longer weapon necessitated the use of a different style of shield. The Scutum was an expensive shield to manufacture. The gradual decline of the Roman Empire meant that less of a focus was placed on the choice of shield or its military advantages.