[EKL] RunQuery returns wrong result, after switching collab space

I am creating an object and setting the unique value to XYZ extension attribute. Before setting attribute value, I am searching that if any object is already present in DB with this attribute value to maintain uniqueness.

Action.1

let rootReference(VPMReference)
let myQuery(PLMQuery)
let results(List)
let currentResult(PLMQueryResult)
let currentResultLoaded(VPMReference)

myQuery = CreatePLMQuery("VPMReference")
myQuery->AddCriterionOnExtension("TestExtension","TestAttribute","abcd")

results = myQuery->RunQuery()

If results is greater than 1, I change attribute value and re-run this script.

Run 1:

Log in details:
Organization: TestOrg
CollabSpace: CSA
Role:Leader

Object is created with "abc" extension attribute value successfully.

Run 2:

Log in details:

Organization: TestOrg
CollabSpace: CSB
Role:Leader

Without closing native app, switched to collab space CSB. Now when run the EKL action, RunQuery() returns empty results. Ideally it should return, already created object.

Your help is highly appreciated.