The problem
You need to cover the whole layer extent, but lines are drawn between vertices always as straight lines on the map canvas (in the selected project CRS). Add additonal vertices to approximate the curved outer boundary of the World Mollweide projection. See here for a similar problem.
Quick answer / generic solution (not software specific)
First create a polygon covering the extent of the map canvas in a projection that is rectangular. Than densify this polygon (add additional vertices).
Detailed answer for QGIS
Proceed the following, simple steps to get this resulting polygon hachured in red with extent form 40° N to 40° S:

Create a new project and a new (temporary) layer with just one feauture in a projection with rectangular extent. I used EPSG:3857 (web mercator) and created one point somewhere on the map. It's just an auxiliary layer as you need an input layer to create a new geometry (step 2).
Use Menu Processing / Toolbox / Geometry by expression, set the layer created in step 1 as input, set output to Polygon and use this expression to create a rectangular polygon with the extreme points of the WebMercator projection (the maximum/minimum extent, covering the whole layer extent). If you want only from 40° N to 40° S, replace the values of +/-85.051129 with +/-40:
transform (
make_polygon (
make_line (
make_point ( -180.000000, -85.051129),
make_point ( 180.000000, -85.051129),
make_point ( 180.000000, 85.051129),
make_point ( -180.000000, 85.051129)
)),
'EPSG:4326' ,
'EPSG:3857'
)
- Use
Menu Processing / Toolbox / Densify by interval. Set the layer from step 2 as input and select a value for Interval between vertices to add of e.g. 1000 [meters].
You're done! Project your map to World_Mollweide by setting the project CRS at the very bottom right in your QGIS window (not the layer CRS) to EPSG:54009. The densified polygon is still in WorldMercator/EPSG:3857, but the densified vertices smoothly reproject on the fly to the projection of the map canvas (project CRS).
If you want, you can re-project the densified layer to EPSG:54009 by either right-clinging layer / Export / Save Features As... or using Menu Processing / Toolbox / Reproject layer and selecting EPSG:54009.
Same procedure, but for the whole extent of EPSG:3857
