If your main character gets a main goal in the middle of the story, are there things you need to do as a writer differently than you would have to do if you were to have your main character get a main goal at the beginning? I think this rarely happens, or at least I don't remember a story where this is the case. This can happen if you need time to finish your plan for your story or if you want to develop certain things like worldbuilding or other characters before making your character set on the main journey, but I was wondering if there are things you need to do or avoid if you choose to do so.
I think if this happens you need to have you main character show the aftermath of getting that goal.
For example if their goal was to be president what is it like to BE president?
On the other hand you can also write their "downfall" from getting that goal. That' should be an interesting story i.e. the rise and fall of a hero.
I don't see a problem with that. Halfway through a story should be some sort of setback.
Your hero can find out their goal up to then is misguided, but it gave you a chance to do some world building. Then they discover a true mission, and it knocks them off their "success high", sets them back on their heels. Their own plans (personal or professional) have to be scrapped in order to pursue this main goal.
The thing you need to do, however, is still follow the 3 Act Structure: Have an inciting incident (about 1/8 of the way into the story), and at 1/4, the hero leaves their normal world, etc. It is just that the major setback at the half way point is realizing they haven't been pursuing the correct goal.
This may look like in the first half you are speeding toward a speedy conclusion, but in fact you are speeding to cliff, and falling off it, and suddenly your hero is in a hole, behind, and desperate.
Yet, still, the hero's experiences in the first act and can be devised to provide experience, knowledge, clues to the main mission in the second half.
And the surprise of the cliff at the halfway mark can provide a great sense of urgency for the rest of the second act, a reason for the reader to feel suspense.
A story is about conflict, and struggle, and setbacks. It does not have to be constant, in fact their should be a cycle. But a story without any, for half the story, is a droning history lesson. You cannot just do a world-building history lesson for half the story!
Look at Star Wars (in release order), or any other good fantasy movie. World building is done simultaneously with the hero struggling, or learning, suffering setbacks.
Heroes become heroes by prevailing despite their setbacks, their mistakes, despite suffering hardship. To be a hero means to survive and prevail, by bravery and taking risks, over circumstances that might well have killed them.
That includes in the first half of the story.
And for the record, there are many stories in which the true path to victory is only discovered about 85% of the way into the story, after previous failures.
Revealing the "true main goal" of the story at the halfway point should not be a problem, just try to make sure the knowledge of the "true main goal" is not easily acquired.