[SOLVED]
I had exactly the same issue with MacBook Pro 2016. After waking up from sleep, it sometimes needed from dozens of seconds to couple of minutes to reconnect to my home WiFi network. During this period WiFi icon was showing that WiFi is connected but WiFi actually didn't work.
I tried many different tricks such as specifying fixed channel number on router, lowering WiFi speed from 150 Mbit to 65 Mbit, forcing long preamble, playing with fragmentation threshold etc. No success.
Then I found this article: https://cafbit.com/entry/rapid_dhcp_or_how_do. It looks like modern versions of MacOS use some tricks to speed up reconnection to the network after sleep. Instead of doing fair procedure of discovering DHCP server and obtaining IP address from it, MacOS just pings (by MAC addresses) several DHCP servers it last used. This approach may significantly speed up WiFi reconnection.
The problem is that most (usually all or all but one) of the DHCP servers MacOS tries to ping actually do not exist in the current network, so from router's point of view MacOS sends in a quick sequence several packets to non-existing MAC addresses. My router treated this as at attempt of DoS attack and blocked my MacBook for several seconds.
Once I disabled DoS protection on the router the problem gone. BTW, this also fixed problem with my printer connected over WiFi, that was loosing WiFi connection.