How it works
In reversed-phase HPLC the neutral form of a molecule is retained far more strongly than the ionised form. Near the pKa, the ratio between the two changes fastest with pH, so retention becomes sensitive to small errors in buffer preparation.
The usual rule is to work at least 2 pH units away from the pKa, where the compound is about 99% in one form. Keep in mind that the apparent pKa shifts in hydro-organic mobile phases, typically upward for acids, so treat the aqueous pKa as a starting point.