This is what happens when we leave empty space in a hive, such as not having the full amount of frames, by leaving one or more out. The bees will build their own structure so they have plenty of storage space and laying room for the queen. Now what?
Check for the queen and move her to a safe space, if she can be easily found. If the queen is not readily visible, she may be under or on the backside of the new comb. So, care must be taken to avoid doing anything that may pinch her while separating the new comb from what ever they have attached it to, whether it's another frame (as shown) or the wall of the box or even the hive cover.
Next ... deciding if there is enough to salvage or simply clean up and discard is evaluated on a case by case, as needed basis, and is often based on how large of a section of new comb is available. Meaning if there's only a small amount of eggs and larvae, or a very large patch the size of a dinner plate ... it may be more trouble than it is worth to attempt to salvage.
If and when there is enough to work with, putting the new comb in a new blank frame, much like is done when preforming a bee removal from a wall, shed floor, roof eave, etc. (see images below) After removing the foundation from a standard frame, rubber bands (or string) can be used to hold the new comb into the frame and supports the comb so it can be placed back in the nest and the bees can continue tending the brood. It may take a day or two, but they will normally fuse the new comb to the frame and promptly remove the rubber bands on their own.
Below is a short video clip showing how an issue like described can be safely remove to salvage any brood and comb that the colony may already be raising in their new comb when you find such a mess. If there is more than a couple of ounces of nectar/honey at the top, that can be difficult to attempt to reconstruct, especially in warm weather. In the case of stored nectar/honey, using a sharp blade to cut below the honey line and removing only the dry section with brood and no nectar will avoid making a bigger mess.
... (see attached video below for more)