In the end I took out the requestAnimationFrame loop that checked needsRender and just called render directly, no issues since.
requestAnimationFrame
needsRender
render