I think there are a lot more important things than age. I've had broody hens wean their chicks at three weeks, leaving them to make their way with the flock on their own. They did. They were raised with the flock from hatch, I have a lot of room inside and out, and my flock is pretty mellow. I'm kind of laid back too, leaving a lot of stuff up to them instead of trying to micromanage everything. I do not do my brooder-raised chicks at three weeks, I wait until five weeks, but my brooder is in the coop so they are raised with the flock too.
Yours are free ranging together. That is great, you are ahead of the game. Since they free range you obviously have a lot of room outside. How much room do you have inside, especially roost space? If you are locking them up together they need some room, enough that the young can avoid the older ones. Places to hide under or behind can help. In the morning my young ones are often on the roosts while the older ones are on the coop floor. It's an easy way for them to avoid.
As long as my chicks are not sleeping in the nests and are in a predator-safe area I don't care where they sleep. My brooder-raised chicks almost never sleep on the main roosts with the adults until they reach a certain level of maturity. With pullets that's usually about the time they start to lay. With cockerels it varies a lot. Some people seem to really worry about where they sleep, thinking they need to roost. Within my limits I don't worry about that, they will work it out.
I often move chicks from my grow-out coop to the main coop. After they have ranged together about a month during the day, I move them into the main coop at night, locking them in there. I lock their old coop so they cannot go back in there. Often I only have to lock them in there once and they then start putting themselves to bed on their own. Sometimes I have to move them in at night a few times before they catch on. I'm down there in the morning at daybreak when they first wake up to open the pop door and let them out until I see that there are no worries. Usually that's the first morning only.