C (gcc), 168 160 119119 114 bytes
-8 Thanks to @corvus_192 for pointing out newline separation between values was allowed, and a massive -41 thanks to @tsh, a further -5 thanks to @ceilingcat
f(lchar*l,*c;f(n,c,i)char*l;char*c;{if(!n)puts?(cc[n-1]=l[i]);else for(int j=0;j<strlen&&(l);j++)ifl[i]-c[n]&&f(!i||c[in-1]^l[j]1,0)c[i]=l[j],f(l,n-1,c,i+1)):puts(c);}g(le,n)char*l;char*e;{char c[n+1];fc=calloc(l,n,c2);l=e;f(n,c[n]=00);}
Prints the newline separated output to STDOUT.