Unable to join secondary replica to the availability group by SQL Server error 47106
I solved the issue. For the error 35237, the hostname that was changed should be of max 15 characters for the node specifier while creating the availability group or else it won't recognize the remaining characters