Random numbers with fixed sum
JavaScript (Node.js), 122 115 bytes



N=&gt;W=S=&gt;2*S&gt;N?W(N-S).map(t=&gt;1-t):(t=(Q=s=&gt;n?[r=s-s*Math.random()**(1/--n),...r&gt;1?[++Q]:Q(s-r)]:[])(S,n=N),Q?t:W(S))


Try it online!