Re-adding a removed smart part causing key already exists

I've run into a strange proplem where if I re-add a removed smart part to a workspace, I get the message saying that the key already exists even though the key does not exist in the workspace or workitem collections. The code is shown below:

If Not WorkItem.Workspaces(WorkspaceNames.CenterWorkspace).SmartParts.Contains(mView) Then
If WorkItem.Workspaces(WorkspaceNames.CenterWorkspace).ActiveSmartPart IsNot Nothing Then
WorkItem.Workspaces(WorkspaceNames.CenterWorkspace).Close(WorkItem.Workspaces(WorkspaceNames.CenterWorkspace).ActiveSmartPart)
End If
ShowFormInWorkspace(mView, "ProfileView", WorkspaceNames.CenterWorkspace)
End If

This code is used in every module we've created except for this one. If we open this smart part, switch to another, then re-open it, the error comes back saying "An item with the given key is already present in the dictionary." with the following stack trace: