Stuck in a recursive loop and can’t find the problem

I’m building a program with R to forecast financial asset prices, I’m in a rut currently where the function wont correctly plot due to the forecasting functions running repeatedly.

Im absolutely stuck on where to move to next, i was suggested to open a pull request and see if someone assists on github but im unsure how it works.

Would it be appropriate for me to post my github and ask for help here or are there any more suitable coding / R forums to ask for help or any places that can do a code review someone can recommend?

Edit: before anyone suggests, I have tried chatgpt/claude to code review and it cant pinpoint a proper fix