BUG: df.resample('MS', closed='right') incorrectly places bins
- [x] closes #55271
- [x] closes #55281
- [x] closes #55282
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

~todo: extra tests for 'B' with closed ='right' (linked issue below), whatsnew~

This fixes a regression from 2.1.0 - but, it also happens to fix two older bugs as a side-effect. So, I've put this in the 2.1.2 milestone
Thanks @MarcoGorelli  Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 2.1.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -x -m1 98f5a787940e02966f2747edbcbd992f0031c277
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
git commit -am "Backport PR #55283: BUG: df.resample('MS', closed='right') incorrectly places bins"
```

4. Push to a named branch:

```
git push YOURFORK 2.1.x:auto-backport-of-pr-55283-on-2.1.x
```

5. Create a PR against branch 2.1.x, I would have named this PR:

> "Backport PR #55283 on branch 2.1.x (BUG: df.resample('MS', closed='right') incorrectly places bins)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                 thanks

ah I put the wrong milestone, this should've just gone into 2.2 as it's just a regression since main, rather than since 2.1

will fixup the whatsnew entry later @MarcoGorelli ping on the whatsnews, they cause merge conflicts on all back ports here you go, sorry for the delay https://github.com/pandas-dev/pandas/pull/55309