KDE does have focus stealing prevention, Have you messed with that at all? https://docs.kde.org/stable5/en/kwin/kcontrol/windowbehaviour/index.html#focus-focusstealing The only thing I can think of is maybe some notification steals the focus and doesnt give it back to the window.
As for restricting access to files you could run them under a separate user account. User A shouldn’t have access to User B’s home folder. Although if its something that would need granted admin access I think it would have access to other users files again.