If you cook baked beans and forget to put it in the fridge overnight is spoiled?

It is generally not recommended to leave cooked baked beans out at room temperature for an extended period of time, as this can lead to bacterial growth and spoilage. According to the USDA, cooked beans should be refrigerated within 2 hours of cooking and consumed within 3 to 4 days. Leaving baked beans out overnight at room temperature increases the risk of foodborne illness, so it is best to err on the side of caution and discard them.