You must convert your polygon layer to a point layer. The "Data Defined Size Legend" is only available when using point layers.
If you use a polygon with a Centroid Fill from polygon and use the Assistant on Size, no "Data Defined Size Legend" will be available.
It's an annoying limitation in QGIS IMHO but at least you know where your problem comes from.
For the polygons to points, 3 solutions:
- To convert polygons to point layers, you can use either "Point on surface" or "Centroids" algorithms in the Processing Toolbox. Main drawback = need to generate again and again the points from your polygons if there are changes.
- To get dynamic layer from your polygon point, you may use "QGIS virtual layers" with a recipe more less like below.

- Use a VRT (use XML based declarations to abstract other data sources) with the following
<OGRVRTDataSource>
<OGRVRTLayer name="ne_50m_admin_0_countries">
<SrcDataSource relativeToVRT="1">ne_50m_admin_0_countries.geojson</SrcDataSource>
<SrcSQL dialect="SQLITE">SELECT *, st_pointonsurface(geometry) AS geometry1 FROM ne_50m_admin_0_countries</SrcSQL>
<GeometryField name="geometry1">
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>EPSG:4326</LayerSRS>
</GeometryField>
</OGRVRTLayer>
</OGRVRTDataSource>
If you should choose between option 2 and 3, it's mainly about portability: virtual layers in QGIS = exclusive to QGIS whereas VRT ("Virtual Format") easy to move, portable with all solutions compatible with OGR/GDAL and it ecosystem.