The hardness of carbon steel is a complex problem, because different brands and materials have different performance grades. According to the fact that stainless steel bolts can't be heat treated, they only have tensile strengths of 500mpa, 700mpa, 800mpa and 800 MPa. I choose grade 8.8 screws for comparison. Hardness requirements: m5-m 16, Rockwell hardness c22-c32, m 18-m39, Rockwell hardness c23-c34.
Because stainless steel can't be heat treated, the strength is improved by cold working and hardening, and the strength improvement brought by this non-phase transformation is unstable. Especially the hardness, there is no way to control it in a relatively small range like carbon steel screws. If carbon steel screws must be said to be "hard", it is because the control interval is small and stable.
I think the object of comparison is not accurate, it should be tensile strength rather than hardness.