It’s inconsiistent behavior. The RGB (0.5, 0.5, 0.5) in the Shader Editor is the visual mid-grey. Nowadays, this is written as a Value (in HSV) of 0.5. The HEX notation denotes the linear value of the red, green and blue colors; if you would measure the Value indicator next to the color wheel, taking the bottom as 0 and the top as 255, you’d get: 11*16 + 12*1 = 188 and 188/255 would yield a Value of about 0,7372549 and thus a RGB of approximately (0.737, 0.737, 0.737).
So the HEX value denotes the ‘absolute position’ and the RGB and (nowadays) Value in HSV denotes the ‘human, visual positon’ (what the average human considers to be half-grey).
In Texture Painting, everything is linear; an RGB of (0.5, 0.5, 0.5) is halfway between black and white, which makes it look darker than mid-grey for humans.
The hexadecimal notation is just a way to easily read binary,; it’s a direct ‘translation.
Between decimal and hexadecimal, the connection is not so straightforward: you count: 0, 1, …,9, A, B,…, F, 10, …,FF (and further if you want).
But in binary, F2, for instance, is just: 1111 0010
In short, the two colors in the Shader and in the Texture Brush are not the same, and this shows in the HEX values.
I am not sure what Gamma correction is exactly, so I will not say if this is wrong in one of them, but your life will probably be better, when you ignore the term whenever you see it 😉