I was first thinking about a problem with the compiler (or "code footprint minimizer") integrated within the Espruino Web IDE, but according to your kind experiments this seems to work perfectly on a Pico.
I wonder why this issue could come from the Nucleo 411....
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I was first thinking about a problem with the compiler (or "code footprint minimizer") integrated within the Espruino Web IDE, but according to your kind experiments this seems to work perfectly on a Pico.
I wonder why this issue could come from the Nucleo 411....