Hi @abigail.serwaah
Unfortunately, the wording of the law is not clear. It could mean that a person has to have had the same permit for the past two years or that a person just has to have had any type of permit(s) for the past two years. I couldn‘t find any more detailed information on it.
My feeling would be that your situation is also fine and that it is more important to have had legal residency here for the past two years than to have had the same type of residency permit for all this time.
Best,
Éanna