The development of efficient, visible light responsive and magnetically recoverable photocatalysts remains a critical challenge in wastewater remediation, particularly for the degradation of persistent azo dyes. In this study, a hierarchical nanocomposite consisting of NH₂-MIL-88B(Fe)-derived Fe₃O₄@porous carbon coupled with graphitic carbon nitride (g-C₃N₄) was successfully synthesized via a controlled pyrolysis and heterostructure assembling strategy. The NH₂-MIL-88B(Fe) precursor was synthesized solvothermally and subsequently carbonized at 500 °C under a nitrogen atmosphere to yield Fe₃O₄ nanoparticles embedded in a porous carbon matrix. The Fe₃O₄@porous carbon was then integrated with exfoliated g-C₃N₄ through ultrasonication assisted self-assembling to form a heterojunction nanocomposite. Structural, morphological, and optical characterizations confirmed the formation of a hierarchical porous architecture with enhanced visible light absorption and efficient charge separation. The photocatalytic performance was evaluated using methyl orange (MO) and Congo red (CR) dyes under visible light irradiation at λ > 420 nm, achieving degradation efficiencies of 98.6% and 96.8%, respectively, within 90 minutes at a catalyst dosage of 0.5 g L⁻¹. The composite exhibited excellent magnetic recoverability with a saturation magnetization of 32.4 emu g⁻¹, enabling facile separation using an external magnetic field. Mechanistic investigations revealed a Z scheme charge transfer pathway with dominant reactive species including •OH and •O₂⁻ radicals. The nanocomposite maintained over 92% of its photocatalytic efficiency after five cycles, demonstrating high stability and reusability. This work highlights a scalable strategy for designing multifunctional photocatalysts for environmental applications.