I think I’ve found the cause of the problem.
The command sudo ls -lh /var/lib/prometheus/metrics2/wal/ showed two directories:
checkpoint.00001219 - current
checkpoint.00016128 - old.
After deleting checkpoint.00016128, the service restarted correctly.
WAL does not check for additional checkpoints, which prevents it from working correctly when the service is restarted.