Did the change from Mikaela to Carly as the lead female helped with Sam's story in DOTM? I think it kinda did, in DOTM Sam is adjusting with the changes in his life. He had to find a life he thinks is comfortable for him while everyone around him(from the first movie) had already found things to do like Bumblebee going on missions with NEST, his parents touring together and his former girlfriend moving on from him. He feels a sort of abandonment without a person close to him to share his griefs. Even his current girlfriend is living in a nice place with a fancy job so he feels he is inadequate and no longer needed by anyone after he had already been useful to the Autobots. DOTM starts Sam's life with a new cast of character new to him and to us so the change from Mikaela to Carly helps sells this because even the one close to Sam never experienced the events of the prior two movies with him. She understands that he did great things before but with no insight on what it was like, she can't go deeper on why Sam is so frustrated with not doing bigger things with his life. So I think even though the change might be abrupt and it might have been a disservice to the end of ROTF's ending where Sam and Mikaela confessed their love or even the first live action movie they did manage to make a good story out of the casting change.
While I get the thought process, I personally think it was a step down to what could've been. We know of only two differences between Carly's role and what would've been Mikaela's role. 1. Sam meeting Carly at the White House. 2. Carly never experiencing what Sam went through. Everything else was directly ripped from Mikaela's role. If Mikaela was there, she would've been getting all of the success and attention, while Sam wouldn't have, making Sam feel worthless even though he's done so much. This ultimately would've been the better direction IMO. I actually made a video about this topic a while back.
In a better film series there wouldn't suddenly be a replacement and we could've had three films to see the two main human actors get close and see their relationship develop and finally (hopefully) end in marriage.
Or, they should have had a Decepticon kill Mikaela between movies. Then Sam would have been angrily seeking revenge in DotM...
Well, that'd be one way to have Sam go from wanting to stay out of it to wanting to get back into the game. I still would prefer that they recast the part of Mikaela, but that's just me.
I would've preferred that everybody involved didn't lose their shit because Megan said something stupid and just kept her.
The reason Megan Fox was fired was because of her comparing bay to Hitler and Napoleon. And Steven Spielberg took that personally. I'm just saying this in case you don't know Now this is just my opinion but the female characters in bayformers were trash but I would've liked Megan to be recast instead of a completely new character who was worse, more annoying and has absolutely no connection with the audience other than being Sam's girlfriend