Windows 10 disconnects network when locking pc

This may be because of a "System unattended sleep timeout" setting that is normally hidden, and that causes a locked computer to sleep even when the "Sleep" setting is set to "Never".

See this answer to a similar question.

Per the link above, the System Unattended Sleep Timeout setting is made available in your power settings if you set the DWORD attribute of the following registry key to "2":

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0