Today I made some changes and was able to fetch the data successfully.
What changes I made?
1. Add the site "https://api.openweathermap.org" in Setup > Security > Remote Site Settings.
2. Add the site in Setup > Trusted URLs and also Enable the CSP directive "connect-src (scripts)"