Since CSL can only sort by macros and variables, you can’t sort by type, as it’s neither of them, IIUC.
https://docs.citationstyles.org/en/stable/specification.html#sorting
Maybe info from https://forum.typst.app/t/pergamon-biblatex-for-typst/5818 can help.