I had hoped to not see him on that stage, though hopefully we get to see him recovering next chapter. Guy didn't expect to eat cookies in what was probably seen as a good hearted token and lose his mind.
If anything, my guess would have been that he'd show up as he did, but gets some of his senses back after hearing that the accusations against Erin and the other fiancees were all made up. Possibly to the point that he would defect from the prince's side and join Rufus.
That didn't happen, so it does indeed feel like Pia's attempts to detox him were for naught.
Personally I'm really menaced by the heroine saying she meant for the prince to feed those cookies to the king... even if she doesn't know they're drugged, she clearly knows it'd change his behavior, huh...
I'm not sure that the cookies are drugged in the literal sense. They have been analyzed by Rufus and the king independently, and no suspicious substance was found.
As part of the game setting, they can carry a form of enchantment or curse unique to the heroine instead. There is no magic in the known setting of this story, but it was likely hand-waved in the original game that Pia knew about.
So the effects would be similar, but it would leave no chemical to be detected. This would also explain how only one character can make these cookies. (This hypothesis would blow up if it is later revealed that the cookies can be reproduced by other people. We'll see.)
That said, she knows that the point is to make the recipient more favorable to her, up to the point of blindly trusting her, so it doesn't change that she tried to alter the king's behavior like she did to her capture targets. This is likely criminal enough, drug or not.