Bruh you put a lot of work into this and I commend what you did here but most of these numbers are just all the way off.
$600k home with $40k down payment is $560,000 loan not a $540,000 loan, for example.
But let's even simplify this and take all the stock market stuff out for Breh A and just assume he simply bought and sold his house and paid taxes on it.
So a property worth $600,000 appreciating at 4.4% for 30 years will be worth $2,246,052.83
Breh A sells the house and is sitting (momentarily) on top of ($2,246,052.83 - $134,763.17[6%]) for a gross total of $2,111,289.67
That amount minus original property value of $600k minus $500k exemption gives us $1,011,289.67 that he has to pay taxes on.
Long-term capital gains on real estate is 20%, so breh ends up paying $202,257.93 in taxes for a final after-tax profit of $1,909,031.74
That's higher than the number you have here, without any stock market stuff.
Please check my math and let me know if I missed something.