Yes, you are right, it it 0 before the first render.
The setTimeout(redoLayout, 0) method works on my computer. Is this guaranteed to work in all situations? It seems a bit weak to me to rely on a time delay. Different devices, different browsers, future versions of browsers etc…
I was hoping that the Babylon engine might have an observable for post render that would be more reliable.
You can use scene.onAfterRenderObservable. You also have engine.onEndFrameObservable.