For whatever it costs, as it seems to be a deceptive mistake, and any additional information can help solve it, I had the same problem.
The request is too large to publish here, and I don’t have time to shorten it now to something suitable, but I can tell you what I found. In the example below, all connections are left connections.
I gradually clarified and changed my request. It has a view (D). And all this was done in a view (T), and then joined to the last table (L). In any case, at some point in its development, not a single field in T that arose in D participated in the union with L. Then a problem arose, the total number of rows mysteriously became less than the main table, which should be impossible, As soon as I will again allow the field from D to participate (via T) in conjunction with L, the number again increased to normal.
It was as if the condition for joining D was transferred to the WHERE clause when no field (through T) in conjunction with L. participated in it. But I really don't know what the explanation is.
source share