Wow, that's what I like about this community! I didn't even know you could add a formula to a course total.
I can't explain why, but I just solved an issue by deleting such a formula. Every quiz in the course would take over 30 seconds to load. Not even the attempt to the quiz, just the click on the quiz. Even an empty quiz would take so long. Then I realized that there was an error in the gradebook total. Fixed it. Everything back to normal.
The pattern is similar to what you reported: course content that is imported every semester plus Moodle version changing every year.