Finally found the rules about that you have to have it made yourself or bought yourself:
"The Public Health Security and Bioterrorism Preparedness and Response Act of 2002 (Bioterrorism Act or BTA), Public Law 107-188, established the requirement that food items, imported (or offered for import) for commercial use, including hand-carried quantities, be properly reported to the U.S. Food and Drug Administration prior to arrival of those items in the United States. The FDA prior notification timeframes (by transport mode) are two hours by land, four hours by rail or air, eight hours by vessel and prior to the "time of mailing" for international mail.
Food that was made by an individual in his/her personal residence, or food purchased by an individual from a vendor that is sent by that individual as a personal gift (for non-business reasons) to someone in the United States is not subject to Bioterrorism Act requirements. However, food that is sent to an individual in the United States by a business is subject to special requirements of the U.S. Food and Drug Administration. For instance, if you go to a food shop in England and buy a gift basket, then take it to the post office or a courier service to send to a friend, the shipment is not subject to BTA requirements. But if you go to that same shop and ask them to send the gift basket for you, the shipment is subject to BTA requirements, and the vendor will have to file Prior Notice. Many travelers are finding that vendors will not ship food directly to U.S. residents because the reporting requirements can be time-consuming to complete.
In general, failure to provide complete, timely and accurate prior notice for Bioterrorism Act regulated items, can result in refusal of admission of the merchandise, movement of the goods to an FDA registered facility (at importer expense) and/or civil monetary penalty liabilities for any party that was involved in the import transaction."
Source:
https://www.cbp.gov/travel/us-citizens/know-before-you-go/prohibited-and-restricted-items and then choose the section "Prior Notice of Food Importation"
I think this explains the reason why the gingerbread house is not allowed as it was neither made by the cruise guest at his/her personal residence, nor was it purchased from a vendor by the individual.