Same problem with Windows 11 forgetting to autohide the taskbar when Automatically hide the taskbar is checked. I tried random combinations of settings in taskbar behaviors and have had better results with:
Taskbar behaviors
Automatically hide the taskbar - checked
Show badges on taskbar apps - unchecked
Show flashing on taskbar apps - unchecked
Show my taskbar on all displays - unchecked
Show recent searches when i hover over the search icon - checked
Share any window from my taskbar - checked
Select the far corner of the taskbar to show the desktop.
I'm using the laptop monitor with an external monitor set to extend displays.
I had the same problems and contacted Microsoft Support and they went into task manager and refreshed Windows Explorer, and I haven't had any issues since.