You can convert an AST to an NHA tenancy while it is still in the Draft state—before the offer email is sent to tenants and the tenancy progression has started.
Once the tenancy is in progress, it cannot be converted from AST to NHA (or vice versa) due to the differing legal requirements and progression steps for each tenancy type. If you wish to convert an AST to an NHA tenancy, you will need to create a new tenancy with the contract type set to "Non-Housing Act tenancy".