Unexpected rebuild error with sshd template

Thank you. The certificate has ended on the domain.
And then (when I renewed the certificate) an error appeared:

Pups::ExecError: rm /etc/update-motd.d/00-header failed with return #<Process::Status: pid 181 exit 1

The script for some reason could not delete the file /etc/update-motd.d/00-header
and a couple more files. I deleted:

root@toxu:/var/discourse# grep -ril "rm /etc/update-motd.d/00-header"  ./
./templates/sshd.template.yml

root@toxu:/var/discourse# diff templates/sshd.template.yml templates/sshd.template.yml.backup
40a41,43
> - rm /etc/update-motd.d/00-header
> - rm /etc/update-motd.d/10-help-text
> - rm /etc/legal

And it worked.
The question can be closed.