the JPEG may only save the SDR image and when it tries to save the HDR image it will interpret it as an SDR image format and the image becomes grey.
Or maybe you have an HDR monitor and something goes wrong when you save the screenshot as a JPEG. This feature adjusts the colour of the video to make it look a little more correct on an SDR monitor (but in reality it is nowhere near the correct HDR colour, even though it looks good). If you have potplayer's HDR to SDR feature turned on, the image will be as nice as your second image. I am having the same problem with Cyberpunk Edgerunners screenshots.