Peter Pettigrew’s return was foreshadowed earlier than in Harry Potter and the Prisoner of Azkaban, in a specific scene where Ron tests his magic.
Harry Potter and the Chamber of Secrets subtly foreshadowed Peter Pettigrew’s return, and this is due to one spell Ron Weasley could not cast. In Harry Potter and the Prisoner of Azkaban, Peter Pettigrew was discovered to be Ron’s rat, Scabbers, using his skills as an Animagus. Prior to that third movie, Pettigrew was never mentioned, and Scabbers was just thought to be a beloved pet, but then the elusive dark wizard became an integral part of the franchise going forward.
In Harry Potter and the Chamber of Secrets, Ron and Harry were desperate to get to Hogwarts after Dobby blocked their King’s Cross access. This led to them driving Arthur Weasley’s flying Ford Anglia to the school and ultimately crashing into the Whomping Willow. In the accident, Ron’s wand broke, which meant his magic also suffered throughout his second year at Hogwarts. One moment when Ron’s magic really backfired was when he tried to curse Draco Malfoy with an “Eat Slugs” incantation and his wand hit himself with the curse, causing him to literally vomit slugs.
While Ron’s second-year magic was temperamental, his failed attempt at transfiguring Scabbers into a goblet in Harry Potter and the Chamber of Secrets was not the fault of his broken wand. It was because he was really trying to transfigure a human, which subtly, in retrospect, offered a clue as to Peter Pettigrew’s return. Transfiguring a human is complicated NEWT-level magic that can go very wrong if the wizard does not know what they’re doing. Even with a working wand, Ron would not have been able to transfigure Scabbers, and the fact that he was able to even manage part of the spell was impressive enough.
Ron’s transfiguration class mishap was not the only time the Harry Potter movies hinted at Scabbers being Peter Pettigrew. Scabbers was alive for 13 years before he was revealed as Pettigrew, which is, as fellow Marauder Sirius Black pointed out, a “curiously long life for a common garden rat,” and it was strange the Weasleys never questioned this. Scabbers was also strangely loyal to Ron; he often disappeared for a while, especially when being chased by Hermione’s cat, Crookshanks, and he somehow made his way back to his owner no matter where he was. It is unlikely that a common rat would, or even could, act like this, though in the Wizarding World there are many things that are out of the ordinary, and Scabbers was the norm for the Weasleys.
The most obvious question about Scabbers’s identity was how Fred and George never noticed Pettigrew on The Marauder’s Map. This seems to be a plot hole in the Harry Potter franchise, as there is no explanation as to why the Weasley twins did not notice Pettigrew with Ron — or Percy, who owned Scabbers first. However, with Pettigrew’s ability to avoid capture even when his true identity was revealed, it is understandable that he was able to do so when no one actually knew who he was in Harry Potter and the Chamber of Secrets, as well.