RE: Off Topic. Weekend6 Mar 2021 16:09
Not advice. Here goes. My understanding is as follows.
With your initial query, my assumption was that you were reversing the "sold in error" quantity (in full) and buying back within 30 days.
This falls under the matching rules and would create a loss or gain (on that matched transaction) which is taxable in the current year at your CGT rate 10% or 20% (rate depending on your other income).
The new example, Comp X, differs from your original query. In this case
Share disposals are matched with acquisitions in the following order
(a) same day
(b) within 30 days
(c) and finally the share pool.
The 21st of March is matched against the 5th March sale. In your example, because or the large rise in price you actual have a loss for CGT purposes of £10,170 (2020/21).
The 50% price rise in a short period would be unusual, although possible I suppose.
Going forward you have 10000 shares will go into the S104 pool at a base cost of £10,060.
The "matching" rule exists to stop shares being sold to crystallise a capital gain or loss, solely to use up the tax free exemption.