Where this goes wrong
Filling 3d before 4s. For potassium, 19 electrons, writing 1s²2s²2p⁶3s²3p⁶3d¹ sums to 19, but 4s is lower in energy than 3d. The ground state is 1s²2s²2p⁶3s²3p⁶4s¹. The count passes; only the order catches this.
Superscripts that miss the count. Stopping calcium at 1s²2s²2p⁶3s²3p⁶ gives 2 + 2 + 6 + 2 + 6 = 18. That is argon, not calcium. Calcium, 20 electrons, needs 4s²: two more.
Overfilling a sublevel. Writing 2p⁸ to reach the count faster claims p holds 8. Each s holds 2, p holds 6, d holds 10. Move to the next sublevel when the current one is full.
Reading only the valence electrons. A configuration ending 3s²3p² has 4 valence electrons, but the atom is not element 4. Every superscript counts toward the atomic number, not just the last sublevel.