Could the giant Torterra in Detective Pikachu be linked to dynamax somehow? Arguably, they did not have much of a purpose in the movie…
Proooooooobably not. The movie was filmed in early 2018, and the script was written in 2016-2017, at which point Sword and Shield would have been in a very early stage of development (presumably Game Freak would still have had all hands on deck for the release of Ultra Smoon later that year). I’m not sure even Game Freak would have known about Dynamaxing at that point – or at least, it could have been only one of several ideas they were tossing around for generation VIII’s flagship mechanic. Even if they were already certain that Dynamaxing was going to be a core feature of the next game, Detective Pikachu was written by American screenwriters who would have had no more special insight into Game Freak’s plans for the next generation than the rest of us. Some higher-up at the Pokémon Company could have told the screenwriters “hey, slip in a giant Pokémon somehow – no reason!” (you wouldn’t tell them why, because that’s an unnecessary risk of a leak), but honestly that seems to me like a weird process to go through. I think it’s more likely to be a coincidence.