Hives swarm for a few reasons and some of it we can control, or try to, and there are times that they just decide to do their thing.
Its virtually impossible to answer your question ( is there anyone that can maybe tell me what went wrong and to tell me what I could have done to prevented this from happening.)
As for time of year and swarm season being over, this doesn't equate, as long as queens are laying, they have resources and temps are adequate, they could swarm later than you think they should.
Reproductive swarms happen early spring and throughout spring. This is nature taking its course, bees perpetuating their species, its normal and healthy and a good thing. As they build up and gear up for reproductive swarming you could add space and or do splits, which could very well keep many hives at bay.
As the season progresses we often run into crowding issues, either there are way too many bees and not enough space or there is enough space but the broodnest has become honeybound. If we don't free up space for the queen to lay, we are asking for them to swarm. If they are congested, they will gear to swarm, adding extra space to allow for hatching brood and congestion may curtail the need for swarming.
Absconding occurs for a variety of reasons, some of them we cannot understand fully. Some of these reasons are intense heat or other weather issues, ants and other critters and sometimes they just decide they don't like the set up.
I also believe that bees will sometimes swarm from one location to another to capitalize on better resources.
All in all, there may be several reasons why your hive swarmed, but usually the answer is congestion of some type.