What's come up for me again and again is that, to change behavior, you have to see what the kid is doing, not what they're not doing. That's kind of a glib way to put it, since the problem you see is her "defying" you, but at 2, that's not really a thing they do. What I'm getting at, though, is, to change a behavior, you have to offer an alternate behavior. At 2, she may well only be able to know she's in trouble, not why, much less how to come up with something better to do. Same with withholding dessert. That has the double-whammy of being a punishment but it not being clear what (to her mind) and being removed in time from the event. Additionally, I don't love the no-dessert punishment because you also want her to be able to eat dinner without expecting that she'll have dessert every day unless she's in trouble.
I have two suggestions. First, what we did when our kids went through this is to put a napkin on the table and say that all food they didn't want should go on the napkin. If they dropped food, we'd pick it up and say, "It goes on the napkin," and put it there ourselves. If they picked up food and seemed to hesitate, we'd jump in and point to the napkin saying, "Remember, put your food on the napkin!" Eventually, it all went on the napkin and never on the floor. It will happen!
Second, and this is more for you, remember that, especially at her age, all lessons are a long game. She's not going to change in a day, much less a meal--in all likelihood, she won't change for multiple weeks. She really isn't cognitively capable of understanding that what you're telling her is wrong is going to be wrong every time. Think about what you want her to do and tell (and show) her how to do that, then be as consistent as you can. If you do that, she can build a habit, whereas if you focus on punishments, she will eventually learn what it is she's doing that is wrong, but she'll still struggle for a long time with the forethought and willpower to actually not do the wrong thing.
Oh, and one of my biggest problems with punishments is, depending on the kid, sometimes it's not long at all before they figure out that they can choose to do what they want and take the punishment. Some don't, but there are plenty of kids who, as they get older will just say, "I don't need dessert," or "I'll just play my game another time," because a punishment is basically giving them two choices, except you get mad if they take one choice over the other. I try to give my kids choices as much as I can, except I never give them a choice where one option isn't actually okay. That just pisses them off that you're being unfair, taking the focus off the behavior you want to correct and putting it on your behavior.