gh-38382: refining the category of all-commuting g-algebras
fixing #38047
### :memo: Checklist
- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.
URL: https://github.com/sagemath/sage/pull/38382
Reported by: Frédéric Chapoton
Reviewer(s): Travis Scrimshaw
Committer
Release Manager