Capital gains on trading stocks

My friend used his $200,000 line of credit to make numerous trades in his account a couple of years ago, buying and selling around $2 million in stocks and earning a profit of $40,000. However, when he entered all of his trades and tried to file his taxes, he was shocked to see that he allegedly owes around $550,000 in capital gains lol. He believes this is incorrect and thinks he should owe less than $20,000. Has anyone else encountered a similar situation? Any advice would be greatly appreciated.