When changing the protection on https://en.wikipedia.org/w/index.php?title=Kingdom_of_England&action=history from semi-protection to extended-confirmed-protection, I submitted the form and was sent back to the "change protection settings" screen with a red "Invalid expiration date." error at the top. I submitted the form again without making any changes, and it redirected me back to the article. However, based on the history, it seems that both protection attempts modified the protection settings in the database.
The expected behavior is for the protection form not to throw an error for no reason - and that if it does throw an error for some legitimate reason, then it should not also perform the action that supposedly caused the error.
I am unable to find [[ https://phabricator.wikimedia.org/source/mediawiki/browse/master/?grep=Invalid+expiration+date. | anything in MediaWiki ]] that creates that error, so it must be [[ https://github.com/wikimedia/mediawiki-extensions-FlaggedRevs/search?q=Invalid+expiration+date.&unscoped_q=Invalid+expiration+date. | FlaggedRevs ]]. (Which does not seem to be in Phabricator?)
I can only find [[ https://github.com/wikimedia/mediawiki-extensions-FlaggedRevs/blob/master/business/PageStabilityForm.php#L242 | one test ]] that causes that error. FlaggedRevs should be modified to not throw that error when the user is not trying to enable Pending Changes.
Apparently this happens fairly regularly, @Primefac mentioned this being something that they encounter routinely. However, there [[ https://phabricator.wikimedia.org/search/query/OY9e8IEIOeXc/#R | does not seem to be any existing ticket for this issue ]].