Purpose This study aims to investigate entropy generation through natural convection and examine heat transfer properties within a partially heated and cooled enclosure influenced by an angled magnetic field. The enclosure, subjected to consistent heat production or absorption, contains a porous medium saturated with a hybrid nanofluid blend of Cu-Fe3O4 and MoS2-Fe3O4. Design/methodology/approach The temperature and velocity equations are converted to a dimensionless form using suitable non-dimensional quantities, adhering to the imposed constraints. To solve these transformed dimensionless equations, the finite-difference method, based on the MAC (Marker and Cell) technique, is used. Comprehensive numerical simulations address various control parameters, including nanoparticle volume fraction, Rayleigh number, heat source or sink, Darcy number, Hartmann number and slit position. The results are illustrated through streamlines, isotherms, average Nusselt numbers and entropy generation plots, offering a clear visualization of the impact of these parameters across different scenarios. Findings Results obtained show that the Cu-Fe3O4 hybrid nanofluid exhibits higher entropy generation than the MoS2-Fe3O4 hybrid nanofluid when comparing them at a Rayleigh number of 106 and a Darcy number of 10–1. The MoS2 hybrid nanofluid demonstrates a low permeability, as evidenced by an average Darcy number of 10–3, in comparison to the Cu hybrid nanofluid. The isothermal contours for a Rayleigh number of 104are positioned parallel to the vertical walls. Additionally, the quantity of each isotherm contour adjacent to the hot wall is being monitored. The Cu and MoS2 nanoparticles exhibit the highest average entropy generation at a Rayleigh number of 105 and a Darcy number of 10–1, respectively. When a uniform heat sink is present, the temperature gradient in the central part of the cavity decreases. In contrast, the absence of a heat source or sink leads to a more intense temperature distribution within the cavity. This differs significantly from the scenario where a uniform heat sink regulates the temperature. Originality/value The originality of this study is to examine the generation of entropy in natural convection within a partially heated and cooled enclosure that contains hybrid nanofluids. Partially heated corners are essential for optimizing heat transfer in a wide range of industrial applications. This enhancement is achieved by increasing the surface area, which improves convective heat transfer. These diverse applications encompass fields such as chemical engineering, mechanical engineering, surface research, energy production and heat recovery processes. Researchers have been working on improving the precision of heated and cold corners using various methods, such as numerical, experimental and analytical approaches. These efforts aim to enhance the broad utility of these corners further.