OS X Text Replacements sometimes not working?
From what I can test empirically here, the text replace function handles 'letters' differently from 'other characters'.

For instance, I can replace ## with € in the middle of a word, yet I cannot make qq do the same thing, it demands either a space, or for me to click on the confirmation box that springs up.

I'd perhaps suggest as a workaround, use a less letter-like trigger.
If it doesn't spring a confirmation box, then it will replace mid-word.
!! @@ ££ $$ etc all work just fine.