How old is your duck?
I copied this from an old post, where a duck had swallowed some string, I know that’s different than candy but still this could be helpful:::;:
“” Do you have any poultry grit? Offer it to her immediately and then just observe.... crops are powerful and can handle a lot so she may pass it just fine but only time will tell. The grit is very important.... you can also try and give her a few lumps of solidified coconut oil (but don’t be surprised if she gets a touch of the runs). But again, wait until you panic. She may be just perfectly fine.”””
Some other duck people will come along soon I’m sure and may suggest some thing better