Using .attach() back to back results in incorrect values?

I’m using .attach() to move between local and scene space for ease of use. However I use this back to back like,

//rotation will usually return an exponent number 
//if I attach objects back to back like this.

However, if I test this same code in Chrome Console one line at a time it works correctly. I’m assuming because it’s not updating correctly due to not having enough time to update between each line.

Anyway to resolve this? (I have tried using timeout which works and results in correct rotations being calculated - but I was hoping for a way to do this without delaying the loops.)