In this research, the waste polycarbonate was hypercrosslinked during the Friedel–Crafts reaction to eliminate metallic ions from the wastewater solution. The experiments for inspecting the adsorption behavior of lead and cadmium ions were conducted at the initial concentration of 20–100 mg/L, contact time of 10–80 min, temperature of 20–80 °C, and pH of 6–11. The isotherm, kinetic, and thermodynamic models have been used to explain the behavior of the metal ions removal process. The correlation coefficient and adsorption capacity of the kinetic model for cadmium ion have obtained 0.995 and 160.183 mg/g, respectively, and the correlation coefficient and adsorption capacity of the kinetic model for lead ion has obtained 0.998 and 160.53 mg/g, respectively, which declared that the cascade was not monolayer. The correlation coefficient of the Freundlich is calculated at 0.995 and 0.998 for Cd and Pb, respectively, indicating the resin plane was not homogenized. The n constant for cadmium and lead ions has been calculated at 2.060 and 1.836, respectively, confirming that the resin is not homogenized, and the process has performed well. Afterward, the values of enthalpy and Gibbs free energy changes were obtained at − 7.68 kJ/mol and − 0.0231 kJ/mol.K for lead ions, respectively, which implies the exothermic and spontaneous state of the process. The values of enthalpy and Gibbs free energy changes have been obtained at − 6.62 kJ/mol and − 0.0204 kJ/mol.K for cadmium ions, respectively, which implies the exothermic and spontaneous nature of the adsorption. Also, the optimal empirical conditions for lead and cadmium ions have been found at a time of 60 min, temperature of 20 °C, initial concentration of 100 mg/L, and pH of 10. At a time of 45 min, the diffusion coefficient and mass transfer coefficient for lead ions have been calculated at 0.1269 × 1020 m2/s and 0.2028 × 1015 m/s, respectively. In addition, at a time of 45 min, the diffusion coefficient and mass transfer coefficient for cadmium ions have been calculated at 0.1463 × 1020 m2/s and 0.1054 × 1015 m/s, respectively. Moreover, the mechanism study explains that the C–O–C and C–H in the aromatic groups have a crucial aspect in the bond formation among metallic ions and resin.