When you type in Linux Bash: date +%Y%m -d '1 months ago', you assume you'll get the year and month of last month.
Well, for a reason that I've got yet to discover (probably very logical), not the case for today's date:
$ date
lundi 31 octobre 2022, 00:11: