What do the OpenGL version strings from glxinfo actually mean?
When creating a OpenGL context you have to specify a profile mask, which is a way of telling the driver whether you want to use compatibility ("legacy") features or not.

Drivers are required to implement all core profile features, but compatibility profile is optional - creating a compatibility context can fail even if the driver supports the version you've requested.

The output from glxinfo you've pasted shows that you can create GL context with version up to 4.5 only when using core profile. If you want to use compatibility profile, the highest version you can request is 3.0.

One reason of the problem you are having is that you:


requested context version greater than 3.0, and
requested a compatibility profile (by setting GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB in GLX_CONTEXT_PROFILE_MASK_ARB).


If removing compatibility bit doesn't help, you'll need to double check if other context attributes are correct.

What I described above is documented in a more detailed way here.