I've noticed there are bad dates for some items in Wikidata - e.g. https://www.wikidata.org/wiki/Q5906
and https://www.wikidata.org/wiki/Q5816 both feature dates with September 31. The data should be sanitized by the code to not allow such things to exist.
Notes from Addshore:
Test edit confirming the issue at https://www.wikidata.org/w/index.php?title=Q4115189&diff=187799522&oldid=187799194
Easy test request in the API Sandbox to make the edit (Just add a token)