There is a problem with DNN 9.1. After locking out a user (from code), the DNN cache doesn't refresh.
Scenario
Q
You can clear the cache programatically in DNN.
DotNetNuke.Common.Utilities.DataCache.ClearModuleCache(TabId);
DotNetNuke.Common.Utilities.DataCache.ClearTabsCache(PortalId);
DotNetNuke.Common.Utilities.DataCache.ClearPortalCache(PortalId, false);
But I doubt this solves your issue since the lockout is not managed by DNN but by ASP.NET Membership.
The lockout is real-time. If you go to Admin > User Accounts > Edit User Account
you will see that "lockedout = true" on the Manage Account tab. At the bottom is a button to unlock a user.