Can't validate sms code when Signup is disable on SMS connection

That is correct, if signups are available publicly then the completion of the signup/login with a new phone number will lead to the creation of a new user.

If you have a scenario where completely public signups are not adequate than you can achieve your requirements by controlling the signup process through your own back-end. Your back-end would then call the endpoint I mentioned before after it had completed all your criteria to allow the actual signup; the endpoint above would also allow to send additional information (fields) when creating the user.