There’s a sign mistake in your formula, and you’re comparing row-level calculations instead of aggregated ones.
The correct formula is:
(m1 + m2 - m3) / m2
If you’re calculating it row by row, you need to use a weighted average to match Snowflake’s result.