Generalising and mandating some sort of 'star rating' + notes along the lines of the ifixit Repairability Score[1] system would be a good first step.
AIUI, for products marketed in the US there are often internal photographs & other documentation (e.g, a totally random example product I found with one of the FCC ID search engines: https://fccid.io/2AMOCKST-900)
Having some semi-standardised set of robustness and repairability criteria and requiring that businesses publish an evaluation of their products against the criteria would at least allow people to get some idea of the 'build quality' or other potential decisionmaking info before buying.
Of course, it would be easy for unscrupulous product manufacturers to find ways to game the evaluations, or just outright lie, so you need some teeth to the rules if caught.
And on the other hand, you're imposing further regulatory burdens on those producing new products, increasing costs and maybe time to market. So there are definitely downsides.
Balancing everything and making it useful without being burdensome is the real problem.
As an afterthought, even if you look inside one instance of a product, there isn't any degree of certainty that if you buy an (externally) identical, matching model number/SKU, it will be the same.
Some regulatory system that actually required version-numbering, or different model-numbering on non-trivial changes would be useful, especially if combined with some obligation to record/announce those version releases, maybe even with some actual change notes.
[1] https://www.ifixit.com/smartphone-repairability