It is starting to flake along the edge because an edges many times doesn’t get as good adhesion. Harder to sand and thinner prime are possible culprits on an edge.
I would sand that spot far enough to each side that you are comfortable that what is left is not going to continue to flake. Then...