There are gaps where the box rectangles intersect. Solution: use the appropriate box drawing chars for line crossings.  Expected result without gaps where the box rectangles intersect: 