MDL-68459 (now split from it), we need to check (and fix if needed) why this is being reported in logs:
95836:[Sat Apr 18 08:37:30.503142 2020] [php7:notice] [pid 24203] [client 172.29.0.9:52928] User id '111001' already has a grade entry for grade item id '253000', referer: http://runcd9a035d2c706523/behatrun2/admin/tool/recyclebin/index.php?contextid=101002
The scenario does delete a quiz and then restores it back from the bin. Worth looking which grade-item is still there, because it shouldn't be the quiz one.
If it's correct and it's just a message informing that existing course... grade won't be restored... all ok.
But it the grade is the quiz one... then we need to investigate why it was not removed when the activity was deleted, because there may be an underlying bug.