A rigid ring or sphere surrounding a single massive body will not be stable, but in the “restricted 3-body problem” where the ring/sphere is infinitesimally light, and one massive body is orbiting another, there can be some stable configurations.
For example, if the lighter of the two bodies is less than 1/9 the mass of the heavier one, a rigid sphere enclosing the lighter body can be stable.
H/T Shubhendu Trivedi