Print at 100 % (no scaling). Verify the ruler with your caliper.
ArUco DICT_4X4_50 · id 0 · 40.0 mm
Check ruler — must measure exactly 50 mm