Okay I found the answer to my problem.
You have to take the version compatibility table dead serious from here.
I my case, I was using Kotlin 2.0.21, that means I had to DOWNGRADE (uninstall and reinstall) an older version of XCode (16.0) as this compatibility table shows: