Today I wanted to buy a few shares of Apple (AAPL), let's say 10 shares.
When I handled the UI, there was the "By number of shares" and "By dollar amount" and then "Market" and "Limit" price, and I clicked this and that, and it didn't accept the order (might have put in 1000 to mean $1000 but the label was "Number of Shares").
So I corrected some mistake and it allowed it to go through, but when it completed, I saw it was a "Sell" order. I am not sure if I clicked on the wrong place by mistake or if I tapped the Tab or space button by mistake. Mistakes happen.
So immediately, I bought 20 shares (to buy back the 10 shares and buy the 10 shares I originally wanted to buy), to correct the mistake. (Update to clarify: I owned more than 10 shares of Apple before I made the mistake and those shares were at a profit). This happened in my 401k account, so I think that sale was not subject to capital gain tax. But what if it happened in my individual account? Then that sale will be subject to capital gain tax for this current year? Is there a way to claim it was a mistake and within 2 minutes, I bought it back, or by some other method, it won't be subject to capital gain tax?
P.S. Update 2021 Apr 14: I just thought of something: since the IRS really would not care what minute and second we bought and sold the stock at, as long as it is the same day (and it was a mistake, really), so could we consider it to be this: (1) we bought the 20 shares of Apple, and (2) sold 10 shares immediately either gaining $0.01 or losing $0.01 or $0.00, so we have close to $0 tax consequence for those 10 shares. And the other 10 shares, it was then just considered to be new investment. Then in this case, it is as if the mistake didn't happen.