I know this may not feel like a good answer to the issue you are experiencing, but I wanted to point out that perhaps an upgrade would be in order. The support of Moodle 25 has ended: https://docs.moodle.org/dev/Releases#Moodle_2.5
I suggest: consider trying a trial/test upgrade on a data-copy of the site to supported Moodle versions and see if it is a bug that has been fixed.