It ended up being a permission issue. AWS EC2 start-up scripts runs as root, therefore it was not able to find the java command neither the minecraft folder, because those were accessible only from the ec2-user (which was the one that i ssh'ed with)
So the solution was to change the command from the start-server-on-boot.sh script that sits inside /var/lib/cloud/scripts/per-boot to the following:
runuser -l ec2-user -c 'screen -dmS "minecraft" ~/minecraft/start_server.sh'
That way it was able to find both the minecraft folder and the java command and the screen session got created with the server up