See:
http://helpcenter.graphisoft.com/guides/archicad-18-int-reference-guide/configuration/attributes/lay...
Even if the other wall layer is turned off, if that layer's intersection group number is the same as the group number for the layer of the visible wall, the gap will appear - as if the visible wall was cleaning up the the invisible one.
When you need to clean up in one situation (both layers on) and not in another (one layer off as here) - then you assign different priority numbers to the layers depending on the layer combination. (Each layer combination saves ALL settings for layers - not just visibility.)
HTH,
Karl
One of the forum moderators
AC 28 USA and earlier • macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB