I can’t find the usage of magnitude in the docs.
Based on the default value, and the source code 5 it seems to be the 3 inside the sqrt.
If that’s the case, you won’t get the same output for gain, magnitude = 0.0003.
For magnitude = 0.0003, you would need to use gain = sqrt(0.0003 / 6).