Query object created with target GL_TIME_ELAPSED is mutated to GL_TIMESTAMP query when used in another thread/context

I create GL_TIME_ELAPSED query objects in one context/thread. I check what driver reports as query target for the newly created query object and I get back GL_TIME_ELAPSED as expected.

Later in another context/thread I try to use the query object. I again see what driver reports as query target for the query object and I am surprised to get GL_TIMESTAMP.

Also, attempt to call BeginQuery(GL_TIME_ELAPSED) will fail, because target does not match that of the query object.

Windows 10

GL Vendor:     NVIDIA Corporation
GL Renderer:   NVIDIA GeForce RTX 3090/PCIe/SSE2
GL Version:    4.6.0 NVIDIA 472.12
GLSL Version:  4.60 NVIDIA

This was my mostly my own bad: Query objects are not shared. Perhaps you could improve IsQuery() to return false for query names that were created in different, shared context?