Ok, I got it to work.
As I'm using a NodeMCU 1.0 the code uploading process is not that straightforward. See thread Arduino IoT Cloud not recognizing NodeMCU 1.0 (ESP-12E).
The problem that caused the soft WDT reset (software watchdog timer) to trigger was the usage of an old ESP8266 board platform on the Arduino IDE. Version 2.5.0 to be more precise.
The solution was to update it to version 2.5.1 or higher, however, keeping it below 3.0.0 as then the Arduino IoT Cloud library wouldn't work anymore.