There could be any number of reasons for a misfire. A code is a symptom, but the root cause should be determined through investigation first before just throwing parts at a code in the hope it will go away. It could have been the spark plug, or the coil, but it now seems clear that it wasn't. Bad carbon build up, a clogged injector, a dirty air filter or borderline fuel pressure pushing a marginal cylinder over the edge, or other stuff I don't even know to tell you about could be the cause. Hopefully the dealership will do a proper root cause investigation before the next round of parts go into it. Best of luck.