You need to reach across a gap
The short field is the defining property, and it cuts both ways. If the job is to attract something from a centimetre away, a coded magnet is actively worse than a plain one. Use an ordinary magnet.
You want maximum pull for the money
Writing a pattern costs money, and dividing the face into opposing poles gives away far-field strength. If the requirement is simply the strongest hold per pound, plain neodymium wins.
A mechanical part would do
A detent spring and a ball bearing is a mature, cheap, well-understood answer. Magnetic detents are worth it when contamination, sealing or wear rule out the mechanical version — not by default.
It is going to get hot
This is a material limit rather than a coded-magnet limit, but it catches people. Standard neodymium starts losing strength it will not recover well before most people expect. If the assembly runs warm, the material and grade matter more than the pattern.
You need one part, tomorrow, in a custom pattern
Custom patterns are the whole promise of the technology and also where cost and lead time live. At volume they make sense. For a single prototype, a standard part that nearly fits is usually the faster and cheaper route.