A person can be legally valid as an Imam yet rank below another valid candidate in the priority order.

Imamah: Six Validity Conditions and the Full Priority Order