Boolean union creates a hole I am trying to create a union of the following meshes:





However, the result has a hole in the geometry. The hole disappears if I nudge one of the objects a little.





What I've tried:


Checking that the normals are oriented properly
Triangulating
Degenerate dissolve
Subdividing
Making sure the geometry is water-tight (I think it is)




The meshes are generated algorithmically, and this only happens some times. Since the entire process will be done in a script, I'm hoping for a general solution that doesn't require manual tweaking.

Thank you!

Here is the blend file:
There should be a slight difference in dimensions on the Z axis which causes boolean to give an unexpected result. Try to scale the cube.001 very little on Z, it will work then: