All I have done is extruded a single cube then applied the Merge by Distance thingy
I bet that normals are not all pointing outwards as I look at your screenshot.
In edit mode, select all faces. Then press shift+N to calculate the normals outside.
(Or go to Mesh > Normals > Recalculate outside)
The reason this happened, is that you didn’t extrude properly. When extruding for such as in the screenshot, you select one face, not four.
Your a god, thank you