I've used Yabai for about three years now, it generally only forgets windows or specifically their states if you use the swipe multi tasking features. However when this happens I have a keybind and Skhd command which quickly restarts the daemon [1] and fixes the windows.
It takes a little while to get used it, but Yabai is now an app I can't live without.
1: launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"