That makes the lack of support in the stock ROMs doubly bizarre.
It's because they use completely different camera stacks. Stock has DRM-protected enhancements but minimal Camera2 support and no raw while AOSP has no enhancements but full API and raw support.
Actually on AOSP (the version Sony releases), they all support both of those things.