WiFi disconnects when an ethernet cable is connected.

Try these steps to use both WiFi and Ethernet as same time:

  1. Open Registry Editor.
  2. Go to HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WcmSvc\Local.
  3. Create/change the fMinimizeConnections registry DWORD to 0.
  4. Close Registry Editor and reboot.

The above is referenced from https://docs.microsoft.com/en-us/windows-hardware/drivers/mobilebroadband/understanding-and-configuring-windows-connection-manager.