Well, we've now managed to verify that what you saw in automated backups is accurate and that there is a quiz/questions issue. But ... I can't answer your next questions:
"What could be the reason for that to happen? " Have not a clue! Am not a programmer/coder.
"So I could imagine that it tried to duplicate all the question bank, could be it possible?" ... certainly possible!
And you've given a hint for you to pursue ...
"I had noticed that recently I wasn't able to duplicate a question, it hanged Moodle."
which you didn't share earlier. Sooooo ....
have a suggestion ... but before using it ... backup your DB (sql dump) ... even if it might be a little confused right now, best to have a backup of something rather than nothing ... reason follows:
There is a tool to check the health ... https://site/admin/tool/health/ ** see note below ...
use this in non-prime time for students and might consider putting site in maintenance mode before attempting above. It is DB intensive and could spike your CPU/processes. Considered 'experimental' but I have used it to clean up issues with quizzes before ... successfully. (but didn't have your specific problem)
It might take a long time to run but hopefully you will see something generated ... normally, it provides a 'solutions' link which normally shows a MySQL query to run from mysql> prompt.
** Moodle's Quiz Master ... Tim Hunt .. will hopefully see your posting and jump in here with much better questions/solutions, etc. So if you can wait, delay my suggestion.
'spirit of sharing', Ken