Think about this formula again. As delay function initial value from 0s to tau depends on initial value of V(in). Although Pulse source can force initial value with DC 0, but for other source likes sine, if an offset is defined, initial at 0 is not possible.
The best is to have formula must set delayed V(in) to 0V between 0s to tau. It can be achieved by adding if condition to the formula.
RMS calculation in B-source, modified from @bordodynov formula
V=sqrt(idt((V(in)^2-if(time<tau,0,delay(V(in)^2,tau))))/tau)