BUG: value_counts can handle the case even with empty groups (#28479)
* If applying rep to recons_labels go fail, use ids which has no
  consecutive duplicates instead. 

- [x] closes #28479 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

xuancong84 found that value_counts() crashes if `groupby` object contains empty groups.
However, even though I made the construction of DataFrame don't skip empty rows, it still crashed.
Till then, I already tried in many ways though, in this time I tried to correct the callee `self.grouper.recons_labels`. After several tests, I found that If freq of `Grouper` is too long so that it has empty groups in some periods then it crashes. And also have found that this is solved by using `ids` which has no consecutive duplicates instead of `self.grouper.recons_labels`.
Sorry for the second commit... Can it be squashed..? @0xF4D3C0D3 FYI you don't need to create a new PR, you can simply rebase and push to the existing one (leave this as its already done) @jreback Thanks for your advice, I just worried that if I had committed something like a trivial typo, it would have made the history of main repo dirty. So for the sake of only one commit, I checkout with another branch and commit with a random message and `git reset --soft HEAD~2` and `git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"` for squashing. You mean that I don't need all this fuss and it's ok that PR with multiple commits as it can be squashed when it merged? > You mean that I don't need all this fuss and it's ok that PR with multiple commits as it can be squashed when it merged?

yes you can do whatever you want, including merges & rebases on a branch; on merge we will squash to a single commit. Wow, that's cool! sorry for my inexperience D: 
I'll practice and learn more to better contribution. Thanks thanks @0xF4D3C0D3 