P-group with derived subgroup of prime-square index not implies maximal class for odd p

Statement
Let $$p$$ be an odd prime. Then, it is possible to have a finite non-abelian $$p$$-group $$P$$ such that the commutator subgroup $$[P,P]$$ is of index $$p^2$$ (or equivalently, the abelianization $$P/[P,P]$$ is an elementary abelian group of order $$p^2$$) but $$P$$ is not a fact about::maximal class group.

In fact, we can construct a $$p$$-group of order $$p^5$$ and class three whose commutator subgroup has order $$p^3$$ and center (which coincides with the next member of the lower central series) has order $$p^2$$.

At the prime two
At the prime two, the opposite is the case:

Finite non-abelian 2-group has maximal class iff its abelianization has order four