It's a good idea to save both at the start of the quest and before you enter the keep, in case you need to pay, to make sure you minimize your losses.
Roaming nobles are also worth approaching. Start moving between settlements and castles and hope there are lords or ladies in the keeps. If you've played through Mount & Blade II: Bannerlord even a bit, you'll know that tracking down nobles can be a bit of a pain and having your resources drained while off on a potentially wild goose chase doesn't make things any better. The former involves finding a lord who actually wants to take the mercenaries off your hands. There's a noble and less noble way of completing the Company of Trouble quest.