This doesn't work. When transferring between Gen 8 games, movesets will reset to what they would have been by level up for that game specifically. For example, if you took a Charizard with Roost as a TM in BDSP, it's moveset would become the four newest level-up moves it is able to learn until transfering back to BDSP. The only way this would work to my knowledge is if you transfer from an earlier gen game where Charizard had roost, such as Sun and Moon, however I don't know if that still works.
Source: Experience