During the restore process, an empty course_module is created by backup/restorelib.php (see around line 1000). "Empty" means there is no instance assigned into this module (slot) yet.
If a module restore fails for some reason, the instance record is not created. User can then see just an icon of an module with no activity title.
As a last step of restore, Moodle should delete all course_modules without instance:
DELETE FROM course_modules where instance=0;
Please note, the empty module is deleted anyway, if user clicks on the icon.