If the deceased committed a heinous crime before his death, simply speaking, he committed a crime of disobedience and was expelled from his home, then he was not qualified to be buried with his ancestors.
However, there are some folk feudal customs in China, which are often considered as an unlucky way to die, which may destroy the family's geomantic omen and affect the family's future luck, so they cannot enter the ancestral graves. Although this is superstition, after all, rules are still rules and must be respected.
Some people will use Yang Yang's eight-character numerology to choose a good day for the deceased to move into the ancestral grave for burial.