3×8 = 24GBApple chose not to use the 12 GB chips in these configurations, but there likely isn't any technical reason why they couldn't. The reason they wouldn't bother is marketing and product mix. ie. From a technical standpoint, they could offer a 48 GB option, but chose not to. Similarly, M2 Pro has 2x8 GB = 16 GB and 2x16 GB = 32 GB, but if they had wanted, they could have offered 2x12 GB = 24 GB.
There are no 12 GB chips, it's always a multiple of 8. And there is a technical reason for that. But you're right Apple is choosing its product mix. The goal is to offer something for every use case and all income groups without creating too many different variants.