Hi, I think it must have been a dream. I'm also not too sure why you would want to do it (will elaborate on that later). Whether you are a "trader" or a "investor", any loss would be effectively be (depending on your status and tax situation) deductable immediately or carried forward to deduct against future profits (or gains).
As a example, should your share sales be regarded as a "investor" and subject to capital gains. The the following principle will apply. Any capital losses will first be set off against any capital gains earned in the tax year, and if after setting off capital gains, any (net) capital losses remains, they will be carried forward to your next year of assessments to be set off future capital gains. Ringfencing provisions may modify the above principle, but the basic principle would normally be valid for share sales.
If you're a trader, broadly the same principles apply, but depending on your own individual situation, trading loss may be set off against other taxable income (e.g. salary income) prior to being carried off. Again, there may be specific ringfencing provisions that may limit your ability to set off against taxable income.
Note, that your suggestion achieves the same result, to the extent the replacement share is sold. i.e, the benefit of the loss is only received when the replacement share is (eventually) sold.
Hope that all makes sense.