Why do rotten onions smell good?
Onions definitely contain sugars, which is why they are able to undergo the maillard reaction. It’s not fermentation, however, if this is to be believed and onions lack the lactic acid necessary for anaerobic fermentation. So there’s have to be yeast present, which seems doubtful in an onion core. Googling for sweet smell and rot turns up “mucor rot,” which is identified as happening based on a wound on the outside of fruits, not at a core. However it clearly indicates that decomposition can result in a sweet scent.