Hi,
yes, using several VLANs generally means you will have a separate IP subnet per VLAN. But in your scenario you only need a second VLAN (VLAN 2) for the WAN port of your RT-AC66U router while all other ports (P1-P4) should use the same VLAN 1, because you only need one single IP subnet (either 192.168.1.0/24 or 192.168.2.0/24) for your internal LAN. Hence, what (at least) is wrong with your configuration is to use VLANs 3 and 4 for ports P3 and P4 of your RT-AC66U router. You should change the VLAN settings of both ports P3 and P4 to "VID 1 untagged".
In additon use your DGS-1224T in default configuration which is also "VID1 untagged" for any port, especially ports P23 and P24 which connect to ports P3 and P4 of your RT-AC66U router.
If you use link aggregation (LAG), as depicted in your configuration illustration, each pair of ports P3 and P4 on your router and ports P23 and P24 on your DGS switch gets logically merged to a single port of double bandwith, while each member port of this bundle loses its identity. This means that the needed VLAN settings (VID 1 untagged) have to be configured for the logical merged port but not for the 2 member ports that the logical port consists of. I don't know how RT-AC66U and DGS-1224T present this "logical port" that comprise the aggregated ports on each device, or if they present a logical port for LAG at all. If not, you have to bear in mind that you have to configure the same VLAN settings for all ports that are member ports of a LAG.
If you use LAG you have to decide if you want to use static LAG or a LAG control protocol like LACP. Whatever your choice is, take care that you use the same method on both sides of the LAG (RT-AC66U and DGS-1224T). In case of LACP both ends of the LAG may be configured to be "active" or "passive". With LACP the LAG only works if at least one end (either RT-AC66U or DGS-1224T) is active. You may also configure both ends to be active.
PT