You are calling function IMPOSSIBLE_LOOP() twice.
The order of execution is not what some would expect.
I assume this is being run from the code console and directly executing the function IMPOSSIBLE_LOOP().
This might help explain the order of execution.
In the code console run starthere()
function starthere(){
Logger.log(IMPOSSIBLE_LOOP())
}
function IMPOSSIBLE_LOOP() {
while (true) {
Logger.log('hello world')
break
}
Utilities.sleep(2000)
return 'return from IMPOSSIBLE_LOOP'
}
Logger.log(`finished running`);