Check your programs and subprograms. One program must open a database in one workspace, and then another subroutine must open it in other workspaces. Of course, this problem will arise.
Suggestion: Add the following two sentences at the end of each subroutine (before exiting the subroutine, of course):
SELE workspace code
use
If the subroutine opens multiple libraries, it is recommended to close them one by one, so that this problem will not occur.
This kind of problem is because it saves time and there is no planning before programming, so we should design it first in the future.