I have a wallet with nothing but a bunch of addresses I imported using importaddress.
I tried using fundrawtransaction with includeWatching set to true but it always tells me I have insufficient funds.
It turns out that for this to work I need to have added the watchonly address using importpubkey not importaddress because otherwise IsMine() on the output's scriptPubKey fails because the dummy signer's scriptSig has 0 for the public key, causing the HASH160 ... EQUALVERIFY part to fail when testing the signature in here:
ProduceSignature(DummySignatureCreator(&keystore), scriptPubKey, scriptSig) ? ISMINE_WATCH_SOLVABLE : ISMINE_WATCH_UNSOLVABLE;
That evaluates to ISMINE_WATCH_UNSOLVABLE even though it is actually solvable, and so stops any of my outputs being considered for inclusion. output.fSpendable is false for each output when CWallet::SelectCoinsMinConf() runs.