Hello, interesting example. Is this for some real life modelling, or just "random testing"? I will need a bit of time to study it before coming back with more specific answers, please allow for that.
In general, the polyhedron warning can be a real issue or sometimes kind of false alarm. A polyhedron with 8 edges, all with use count 1 sounds like a couple of loose faces, so possibly a real issue.
In general, you want solids to slightly overlap each other, i.e. not "exact" face/face intersections as that can be ambiguous. This sort of thing can sometimes be a little tricky to get right. As noted, I will try your code later.