Abstract The dense deployment of Internet of Things (IoT) networks in smart cities poses severe challenges in spectral efficiency, energy consumption, and interference management. This paper addresses the joint optimization of three-dimensional (3D) beamforming, subcarrier assignment, and power allocation in a multi-carrier non-orthogonal multiple access (MC-NOMA) network supporting both device-to-infrastructure (D2I) and device-to-device (D2D) communications. A robust percentile-based channel model with spatial shadowing correlation is adopted to cope with urban propagation uncertainties, and an accurate elliptical footprint model derived from the 3-dB antenna pattern is used to evaluate coverage gaps and beam overlaps. The resulting mixed-integer nonlinear programming problem is solved by a three-layer memetic particle swarm optimization (Hybrid PSO) algorithm that combines a fixed-point Successive Interference Cancellation (SIC-aware) power solver, an iterative Hungarian method for subcarrier assignment, and an adaptive multi-phase local search. Simulation results demonstrate fast convergence, with the network power consumption stabilizing at 88 mW at a 600 MHz carrier frequency. The proposed MC-NOMA with 3D beamforming consistently outperforms baseline schemes that employ OFDMA with shared spectrum or uniform linear arrays, especially under high channel estimation errors, strong external interference, stringent coverage constraints, and increasing user densities. The findings confirm that the joint framework significantly enhances energy efficiency and robustness, making it a scalable solution for next-generation urban IoT networks. Similar content being viewed by others Funding No funding was received to assist with the preparation of this manuscript. Author information Authors and Affiliations Corresponding author Ethics declarations Competing interests The authors declare no competing interests. Additional information Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Rights and permissions Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as