Remove everything but first 'source-directory' line in /etc/network/interfaces
.
Using nano:
sudo nano /etc/network/interfaces
Use CTRL+K to delete lines, CTRL+O to save, and CTRL+X to exit nano editor.
Enable 'dhcpcd' with:
sudo systemctl enable dhcpcd
sudo systemctl disable networking
Restart the Pi to have the changes take effect.
Reboot from GUI, or use terminal command:
sudo reboot
WiFi should work now.
This worked for me on a Raspberry Pi Zero W running Raspberry Pi OS Lite 5.15.