If contract B is in the same location (as defined for the 24 month rule), then the 24 month thing doesn't come into play at all.
Also, OP hasn't said whether there are substantive T&S expenses at stake here.
Can you walk away? If your contract has a notice clause, of course. You agreed to a contract, you abide by it, but if the notice clause is in there you aren't breaking the contract by invoking it. And it may be they wouldn't even object that much if you did, given the story here.
Should you walk away? I wouldn't. When you shook hands and agreed to stay, you made an agreement.
Can you negotiate? Absolutely.
Seems like they can't afford you and they can't afford to lose you. So if you get the offer, tell them about it. And say, "I can help your budget problems some AND give you a hand. I'm willing to work from home for 12 hours on the weekend for the next four months. I can even talk to this new contract about, instead of working out my notice here, letting me come in one day a fortnight for the next four months." Something like that. This can be a win-win, where they save money but get enough of your services to help them out. And you have two clients at the same time, which is both lucrative and somewhat helpful as far as IR35 goes. And maybe it spins into a long-term part time retainer deal with them, if you are really lucky.
Are you a business or a temporary employee? If the former, then try to leverage the situation into a stronger and long term business relationship with at least one of your clients. And if your new client knows you have an on-going part time deal with another client, it gives you stronger leverage with them in any future negotiations.