That's a lot of monkeys
C, 192 bytes

i;g(s,b,i,n,j)char*s,*b;{for(b[i+1]=0;b[n+j];++n)s[n]-b[n+j]&amp;&amp;(n=-1,++j);return n;}f(char*s){char*b=calloc(strlen(s),1);for(i=0;s[i];)i=(b[i]=putchar(rand()%95+32))-s[i]?i?g(s,b,i,0,0):0:i+1;}


Try it online!

It's a mess now, but at least it works even for the corner cases...



C,  63   62  61 bytes

Thanks to @Jonathan Frech for saving a byte!

i;f(char*s){for(i=0;s[i=putchar(rand()%95+32)-s[i]?0:i+1];);}


Try it online!