Why Tasker can't recognize WIFI SSID
I think we're going to need some more information; always good practice whenever troubleshooting any system, look at the log files.

Switch on logging for Tasker using the instructions here: https://tasker.joaoapps.com/userguide/en/faqs/faq-how.html#x2

Set up your profile with no SSID name so you get a green profile, toggle the wifi off and back on again, then look at the log file.

Then set up your profile with your failing SSID name, toggle the wifi again, look at the log again.

Are there any obvious differences or error messages which start to point us in the right direction?