But the effort required to build such a structure, even if physically possible is far more than building the equivalent in a swarm and the utility of such a swarm is greater especially when you consider that the typical sci-fi trope of living on the surface inside of that sphere is ruined by the complete absence of any gravity exerted by the actual sphere on that surface. This means that all of those hapless residents would instead get pulled from the surface into the star in the centre.

This is precisely the appeal of Larry Niven's Ringworld concept. You instead take a slice of that sphere and spin it around the star and generate gravity through centrifugal force. They can take a number of configurations but the default one would give you the equivalent of 2 million earth's worth of living space inside one continual surface. This is obviously hugely mass intensive and having a ring of that kind of radius spinning at the tangential velocities required for the equivalent of one g of simulated gravity (around 1200 km/s) requires materials so magically strong that they make graphene look like soggy tissues. The only material that could do this even in the theoretical realm is magmatter, which would be materials constructed out of magnetic monopoles, something that has been predicted to exist by some but has yet to be observed.

However, you could construct one using known materials by creating a superstructure around the ring that is much more massive and orbits the other direction at normal orbital speeds for a body about an AU out from the sun with the ringworld electromagnetically suspended from the superstructure, normalising their collective momentum to zero. That obviously greatly increase the mass requirements but this could mostly take the form of hydrogen and helium which is far more abundant than heavier elements and would be usable as fuel for fusion reactors. That superstructure can contain many smaller rotating habitats and the whole thing could be used as a vast habitat for microgravity living as well - something I envision as many humans doing as living on worlds with gravity by the time we would have constructed one of these.

You also want to have a superstructure because at such a high tangential velocity, if a human being of 80 kg struck the ring from the outside, it would blow with the kinetic energy of a thermonuclear bomb. Point defence is absolutely necessary and the superstucture offers both an excellent shield covering the non sun lit side of the ring and a great platform for hosting those point defence systems. Ringworlds are also not in stable orbital configurations over astronomical timescales so you need to maintain their orbit through corrective thrust. This could be done through light sails which would also be appealing for it's mechanical simplicity.

Ringworlds are very mass intensive especially if your civilisation still has no access to unobtanium building materials and I don't think this would be something we would ever build a lot of in our particular solar system but even with that mass cost, you could easily gather enough rocky material from the sun to build a few and still have the vast majority of people living in other far smaller structures (but only relative to a star encompassing ring) in the swarm.