It would be safe for a formerly H-1B returning on AP to apply for H-1B extension prior to the expiration of AP. Upon you receive H-1B extension approval with a tear-off portion of I-94, you may start using the AC 21 to transfer your H-1B.
That is just my personal opinion.