Well, young person!! The reason you are getting different answers is because there is NO DIRECT solution to your equation!!. I can readily see that this a combined financial equation for a future value of $1,307,997.74, a present value of $100,000, a periodic payment of $5,000 and 40 periods, which appear to be "years". You can only solve for "i" using iteration, or trial and error method. You can easily solve it by using a dedicated financial calculator, if you have one.
Go online and use this financial calculator: https://arachnoid.com/finance/
1- Enter $100,000 as negative under "pv"
2- Enter $5,000 as negative under "pmt"
3-Enter 40 under "np"
4- Try any interest rate and enter it under "ir"
5- Press "fv" and compare the amount to your $1,307,997.74
6- Change the interest rate in "4" above until you get as close as possible to "fv" of $1,307,997.74.
Note: I tried it on your behalf and got 5%, which gives the exact "fv" of $1,307,997.74 !!!.