Liquid candy
TSA’s candy entry says liquid or gel food over 3.4 ounces isn’t allowed in a carry-on.
Flying home from abroad
TSA’s answer covers screening at US airports. On the way home you go through the other airport’s screening first, and its rules are the ones that count there.
Coming home through US customs
Candy isn’t on either agency’s traveler pages. Declare it, and the CBP agriculture specialist decides.
Declare it either way. USDA says declared food brings no penalty, even when it’s refused. What happens if you don’t.
TSA puts this on every entry: “The final decision rests with the TSA officer on whether an item is allowed through the checkpoint.”