I understand that your problem is related to conservation, rather than the cultivation of onions. In general, golden onions keep well and even if harvested in August they should last you all winter, while red onions are a little less durable. However, there are some precautions necessary to make onions last a long time after harvest.
How to make onions last longer
First, after harvesting, the onion must be dried, even if from the outside it may seem dry the bulb risks having too much moisture inside, which will cause it to rot. In particular, a spore called black mold may develop which completely ruins the inside of the onion, it could be your case.
I advise you to leave the onions in the sun for a couple of days during the day. sheltering them at night, which is generally more humid. Then they should be kept hanging for a few weeks as per peasant tradition, in a shady and airy place, the ideal would be a porch.
Once they are properly dried, you can keep them in a dark and cool place to keep them from sprouting and not damp to prevent them from rotting.
I hope I was helpful!