Only the proportion of the mortgage that was explicitly used to purchase the investment property can be offset against rental income. You cannot secure other borrowings against your Investment property to reduce your tax bill.
It sounds as if you've been given "bar room" tax advice, that a Broker or someone selling you your consolidated mortgage gave you confusing or incorrect information.
From the begining: You bought property A for how much ... what happened next? Which is your Investment, which is your own residence, how much of the mortgage does each represent?
In this type of scenario you should have 2 completely seperate mortgages, Investment Interest Only and Residential on a repayment basis. Use the saving by going IO on the investment to pay down your Residential property. Quite why you would go in the opposite direction is a mystery to me and smells as if you were missold something, or conceivably became an "accidental" landlord by renting out your old residence when you traded up and, again, received poor advice.