Carbon dioxide (CO2) sequestration in underground aquifers offers a viable solution to mitigating global warming by reducing atmospheric greenhouse gas concentrations. However, the efficiency of this process depends on intricate heat transfer dynamics, necessitating comprehensive numerical and experimental analyses. Conventional computational fluid dynamics (CFD) methods and experimental approaches often fail to capture the complexities of CO2 sequestration. Unlike previous studies, which primarily focused on homogeneous porous layers, this study employs the mesoscopic Lattice Boltzmann Method (LBM) to investigate fluid displacement and heat transfer in the CO2 injection through spanwise porous layers of varying porosities initially saturated with water and sandwiched between parallel heating plates. The investigation of the dynamics of CO2 injection offers a novel perspective on fluid displacement, addressing the influence of the Richardson number, a key indicator of the balance between natural and forced convection. The ultimate objective of this study is to identify the most efficient regime for transporting fluids, specifically CO2, through these heterogeneous porous layers. Multiple Richardson numbers are examined to comprehensively understand the roles of natural and forced convection. The results are analyzed and correlated with the average Nusselt number, providing valuable insights into optimizing fluid transport within porous structures. This research advances the understanding of CO2 sequestration and contributes essential knowledge for developing efficient and cost-effective strategies in combating climate change through underground carbon dioxide storage.