ESP32 after Wifi and bluetooth off - not able to connect to Wifi again.

i tired it like it is described in this article on gidhub
i stoped wifi and bluetooth on the first core of the ESP with the commands in the loop().
if(((now.hour() == 22) && (now.minute() == 0) && (now.second() == 0))) 


but after the lines below there is only a connection for about one second than its disconnected again.
the wifi connection is executed from the second core. 
WiFi.config(local_ip, gateway_ip, subnet_mask, dns_ip);

WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED)

if it is desired, i could post the full code, but maybe anyone had the same problem like me.