Open the Registry Editor.
Go to the following Registry key.
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3
On the right, modify the binary (REG_BINARY) value Settings. Set the first pair of digits in the second row to 03 to make the taskbar auto-hide. Change this value to 02 to disable it.
There may be a number of other possible wayouts to fix the issue.
Ref:
Windows 10 Taskbar not hiding? Here is the fix!