It’s my understanding that detecting this is a hard problem mathematically.
Easiest thing is to just node edit one of the shapes so that they overlap, so starting with:
Node edit the lower one with the shorter segment on the overlap:
so that the Boolean union will be successful:



