Changing 529 beneficiary from first cousin to spouse

I created a 529 account for my cousin and deposited funds there, but he got a full scholarship and won’t be needing my help. On the other hand I will be paying for my spouse’s college tuition this year. When I started the process of transferring to her 529 account, the brokerage asked me if they were related and warned me that there would be a tax penalty if they were not. Should I first change the beneficiary to myself and transfer the funds to my own 529 account, followed by a transfer to her account? Are multiple changes allowed in a calendar year?
I’m not sure if the IRS recognizes that they are related - this is what I see in the relevant section:

  1. Son, daughter, stepchild, foster child, adopted child,
    or a descendant of any of them.
  2. Brother, sister, stepbrother, or stepsister.
  3. Father or mother or ancestor of either.
  4. Stepfather or stepmother.
  5. Son or daughter of a brother or sister.
  6. Brother or sister of father or mother.
  7. Son-in-law, daughter-in-law, father-in-law,
    mother-in-law, brother-in-law, or sister-in-law.
  8. The spouse of any individual listed above.
  9. First cousin

@BelknapPoint

I’d consult a CPA on this or take the two step approach you mention. Your plan administrator can answer the question about limits on number of times one can change a beneficiary but I don’t think there are any.

QTP (529) rules are outlined in pub 970:

This includes the list you have, as well as spouse of beneficiary, as members of family. Common sense would suggest that your first cousin is also your spouse’s first cousin but there is no language supporting that assumption. So unless there’s clarifying language from the IRS on this (which a CPA would know) I’d take the safe route and follow the letter of the guidelines, which would allow a tax and penalty free change in beneficiary to you (as first cousin) and then your spouse. How you’d document first cousin relationship if challenged I have no idea.