Solved. In the end the problem was the nas firewall. I have deactivated it and it is working.
A suggestion. It is not necessary to create exit rules to access the internet with wireguard. You can leave the rules in Firewall - Nat - Outbound on automatic. Opnsense creates them automatically. That works if you have created the interface for wireguard in Opnsense.