glXCreateContext() Does not work with NVIDIA shipped drivers on ubuntu buntu 22.04.3 LTS

I am facing the issue to use glXCreateContext() with NVIDIA GeForce RTX 4060 Laptop GPU/PCIe/SSE2

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 545.23.08
penGL core profile version string: 4.6.0 NVIDIA 545.23.08
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

when using NVIDIA shipped drivers, glXCreateContext() does not work. The rendering window automatically gets closed.
I tried remove/re-install of drivers. But the same issue.

When I use OS provided Nouveau drivers, it works.

If anyone can suggest if this is a bug in driver OR any configuration issues/workarounds ?