I have come across this bug where changing between certain screensets I use causes loss of focus in the Reaper window and I therefore have to click back in the Reaper window itself to restore focus.
I originally thought it may have been related to the key mappings I was using for the screensets but I have changed them with no difference in result. I tried clean installs of the latest Reaper release and prerelease with generic on-the-spot created screensets and couldn't see the issue. It must be something related to the screensets I am using?? Also note as shown in the licecap below I can change between certain screensets of mine all day without issue, but switching between the F6 and F8 screensets of mine shows the issue almost straight away every time.
Sorry for the big licecap but I had to capture over 2 monitors. The program I am using is a utility called focus.exe which shows focus changes between apps/windows in Windows. You can see when I go between F6 and F8 near the end that the Reaper window loses focus. When the problem occurs, the focus goes back to whatever was the last application in Windows that had focus before Reaper.
This is on Reaper 5.20rc3 x64 Windows, but also happens on Reaper 5.18 x64 Windows when I restore my config to a portable installation there. I'm using Windows 7 SP1 x64 as OS.