Whatever this was, doing an in-place upgrade to the 20230301 release fixed it. This might have been a regression in the LineageOS version I was using.
My auto rotation broke again, and was fixed again by doing an in-place system upgrade.
There must be a system cache or bit of data somewhere that's getting corrupted, but I don't know where that data would be stored internally, or what to look for.
The only thing strange that happened before it broke was that from a cold boot, the lock screen had a weird bug where pressing the power button didn't show anything -- the LCD backlight activated, but there was nothing on the screen, where normally there would be the clock and the lockpad icon. I was still able to swipe up and enter my unlock pattern. I've seen this once or twice before, and it might be related to when the auto rotation breaks. I'll have to watch for when it happens next time.