im not sure if this is the correct place to ask...

My question is about following the opinion of your local imam. how important is it, is following your local imam a must? is it ok to follow him in some matters, but follow another imam (not your local) in other matters?

if one follows one opinion from another imam other an their local (this other imam could be in a different country, city, town, etc), and then found out that their imam follows a different opinion, do they have to go back and rectify that act of worship. for example (i dont know the exact rulings of zakaat, so excuse the ignorance, this is just an example for arguments sake) if you followed and opinion that said the amount of zakaat to be paid is x and then your local imams opinion is that the amount of zakaat to be paid is y, do you have to go back and pay back the correct amount i.e the amount that conforms to the opinion of your local imam?