A lot of how you handle it depends on your geometry source - i see you are dealing with conversions from Mesh to Solid and that is always going to be a “Hope and Pray” because I have used a very similar method when dealing with meshes and it works 75% of the time (because sometimes the meshes aren’t watertight and cant make a solid.)

At the end of your method you are probably ending up with some list of solids and potentially other geometry primitives (Element.Geometry may return Solids, Meshes, Points, Curves, Surfaces). What i’d suggest is testing the data out of the Element.Geometry (String.FromObject - then test if the Strings = “Solid” and Filter By Bool Mask to get only the solids) that way when you get to Solid.Centroid you are only dealing with Solids coming in.

Once you have only a list of Solids (assuming Single Material) then along with Solid .Centroid you also need to do Solid.Volume to get the contribution of each indv centroid to the overall centroid/C.G. Then what i do is get the X,Y,Z coordinates of each centroid point. then to get the overall Centroid X coordinate - its just a matter of taking each X coordinate and multiplying it by it’s corresponding Volume. Take the sum of all the Coordinates x Volumes and divide by the Total Volume of Everything (the sum of all the Volumes) - that would be the overall centroid X coordinate. Repeat for Y and Z. Then feed the resultant X, Y, Z into a Point.ByCoordinates and then feed that point into your Family Placement node