Windows and doors are "hosted" by the wall that they are inserted into. They only cut holes in the host wall.
Dragging them out of that wall leaves them floating in space... but still hosted by / associated with the original wall.
In your screenshots, it appears that the circled window was hosted in the wall below. You must place the window in the gray wall itself. (Dragging a copy upwards does not change the host.)
If your wall spans multiple stories, then windows/doors can be moved from story to story. You must use the Floor Plan Cut Plane to generate your floor plans in this case, as the symbolic representation will not show the openings on the proper stories/floors.
One of the forum moderators
AC 28 USA and earlier • macOS Sonoma 14.7.1, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB