The correct way to work with screenshots is to first assign your monitor profile, then convert to the target space (usually sRGB).
Then the colors will match.
A screenshot is no longer in the original document color space, but in monitor color space. So the monitor profile is the correct one to represent the numbers. Hex has no particular relevance here, it's just an outdated base 16 notation for RGB numbers.