The fix may be simple enough but then again.
It appears the molding may have simply shrunk after it was installed, but that may not be the only reason it has separated. In bearing walls there is plenty of nailing to keep crown in place. in non bearing walls... not so much. More on that later.
The fix at the minimal will be to clean the old caulk out. You could go straight over the old but the joint will not be a clean line and the paint will only show how rough the caulk job is. After all the joints are cleaned and ready for new caulk, you could simply re-caulk and paint and be done with it hopefully. I would re-nail the crown so it all goes back tight to the wall, making certain all studs and joists are found. A stud finder is critical for this step.
Now to the non bearing walls. Finding the studs will not be a problem. Joists are a different matter since they will run parallel with the walls. Here you will only have a top plate to nail to. All other places the trim has been able to be nailed along the top and bottom edges, on non bearings walls, it is usually not possible. The bottom edges are easy, but not a longer nail needs to be directed to the top plate of the wall. to help keep the top edge in place. AS a note, you may be able to find the drywall backer to nail the top edge to if it extends out far enough and is nailed solidly.
If the crown was 3" wide or smaller, the nailing could be done through the center of the trim, into the top plate. Yours looks like a 4" crown, wide enough to need nails at both edges. I bring this up only because crown nowadays is really thin in its cross section. Driving nails in the center to set the crown in place COULD split the crown. I have done this. In a re-nail such as this I would be driving all nails by hand to feel the nails hit the stud. Something you cannot typically do with a nail gun. You can learn over time to hear the difference with a nail gun, but that comes with a lot of experience. If you can only find the top plate and not the nailer in a non bearing wall, and the nails need to be driven through the center, drill a pilot hole so the nail shank has a snug, not tight fit into the hole for the 3" nail you will most likely need to do this.