You may need to find out more about 'close company' legislation.
Basically, a 'close company' is one controlled (defined as having >50% of voting shares) by 5 or fewer 'participators' (basically shareholders, but quite broadly defined). I'd guess that both your companies are close companies in that you alone control .
To the best of my knowledge, if a 'participator' receives a loan from a 'close company', the company giving the loan must pay a tax deposit of 20/80 of the amount of the loan. Y
Therefore, the key issue here is whether Co B is deemed to be a participator in Co A- my gut feeling (but I stress that I am not at all certain about this advice!) is that there would need to be a 'cross shareholding' between Co A and B (ie Co B owns some of Co A's shares) for B to be a participator in A and for the issue of surcharges to arise.
You may need to check with your accountant to see if Co A paid such a deposit to the Rev Commsrs when the original loans were made- if it was paid, then there would be a distribution issue arising or a charge to tax on the part of Co B. Additionally, the tax deposit would be lost, I think. I a tax deposit was not paid, then either there's been an oversight [ i.e a deposit SHOULD have been paid but wasn't] or else a distribution won't arise. Co B however, may have some other tax issue arising as it will have benefited by eliminating a liability from its books. Co A would probably be entitled to a bad debt write off which is allowable for tax.
Overall, it's a very tricky issue and I want to stress that the best person to deal with this is your accountant. The only thing I'd note is that - to quote your original post- your accountant said the writing off of the loan would 'probably be treated as a distribution for company B and it will be subject to surcharges'. It sounds like s/he's unsure and I personally wouldn't be at all sure that Co B would have a distribution issue- maybe another type of tax but not a distribution!?