We are suspecting that the magnet, that should be securely affixed to the flywheel, came loose.
While it was loosening, it was causing the rattle.
Once the magnet is loose there will no longer be any spark.
So your next step is to remove the starter shroud (4 bolts, 8mm socket) and have a look.