The present study addresses theoretically and computationally the performance of electrically conducting water-Fe3O4/CNT hybrid nanofluid in three-dimensional natural convective heat transfer and entropy generation within a wavy-walled trapezoidal enclosure. The enclosure has two layers -a hybrid nanofluid layer and a porous medium layer. A transverse magnetic field is applied in the upward direction. Newtonian flow is considered and the modified Navier-Stokes equations are employed with Lorentz hydromagnetic body force, Darcian and Forchheimer drag force terms. The wavy side planes are heated down while the top and vertical planes are thermally insulated. A rectangular heated fin is placed in the lower plane and several different locations of the fin are considered. The transformed, non-dimensional system of coupled non-linear partial differential equations with associated boundary conditions is solved numerically with the Galerkin finite element method (FEM) in the COMSOL Multiphysics software platform. The effects of Darcy number, Hartmann number, volume fraction, undulation number of the wavy wall and Rayleigh number (thermal buoyancy parameter) on the streamlines, isotherms and Bejan number contours are studied. Extensive visualization of the thermal flow characteristics is included. With increasing Hartmann number and Rayleigh number, the average Bejan number is reduced strongly whereas average Nusselt number is only depleted significantly at very high Rayleigh number and high Hartmann number. With increasing undulation number, there is a slight elevation in average Bejan number at intermediate Rayleigh numbers, whereas the average Nusselt number is substantially boosted, and the effect is maximized at very high Rayleigh number. Increment in Darcy number (i. e. reduction in permeability of the porous medium layer) is observed to considerably elevate average Nusselt number at high values of Rayleigh number, whereas the contrary response is computed in average Bejan number. The simulations are relevant to hybrid magnetic nanofluid fuel cells and electromagnetic nano-materials processing in cavities.