This question already has an answer here:
If I ate a hamburger that I thought was kosher and after I finished it I found out it was not kosher, where does that leave me halachikly speaking. I know in Mishnah Torah it says (Blessings 1:19)
Whoever eats forbidden food, wilfully or in error—recites no blessing either before or after.
What if I said Hamotzi before the meal? Assuming the bread was kosher, was the bread the Ikar of the meal and do I still say Birkat Hamazon? Or does the unkosher burger meat still prevent me from it?