To both program a new remote or a new chip encoded key on my old My Mazda 6 there are similar procedures that the Dealer does not want you to know about. “Turn key to accessories position, open and close door twice, scratch your ass, push lock button on remote” Voila’ welcome to you new working remote. Might have gotten one of the steps wrong. But you get the picture.
I think the scratch your ass part is important. ..