Thickness-induced violation of de Haas-van Alphen effect through exact analytical solutions at a one-electron and a one-composite fermion level