Metastable phases in rare-earth permanent-magnet materials