Welcome to CadTutor!
Maybe add fuzz factor to equal function or round off numbers.
What you see is not always what you get.
Autocad may show so many digits (for efficiency purposes / smaller files) , under the hood it probably uses more for calculations.
Its like PI , you learn its 3.14 but you know the list goes on.
So use something like (equal min1y -max2y 0.0001) or whatever fuzz makes you happy.