How are q-values for pearson correlation are calculated?

This thread provides links to the methodology / underlying methods - that might explain the difference you’re seeing: