In 5G NR for PDSCH PHY processing, the scrambled bits after the modulation mapper go through a layer mapping operation followed by antenna port mapping, as shown below.
Where the maximum number of layers $(N_{\nu})$ that can be assigned is equal to $N_{\nu, \mathrm{max}} = 8$ and the maximum number of antenna ports $(N_{p})$ for PDSCH is equal to $N_{p, \mathrm{max}} = 12$ with $p = {1000, 1001, \cdots, 1011}$.
The antenna port mapping operation is defined in $138.211$ as
You cannot map 8 layers to 12 antenna ports. You can see in the equation, v layers are mapped to v antenna ports, and the set of antenna ports are determined according to table 7.3.1.2.2-1 to 7.3.1.2.2-4 in 3GPP TS 38.212. In this case, the PDSCH antenna ports mean 1000+dmrs ports.
For example, 8 layer with dmrs-type=1 and maxLength=2, will be mapped to 8 antenna port {1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007} according to Table 7.3.1.2.2-2.