Intermediate structural phases in rare-earth substituted BiFeO3