Google's John Mueller made it sound like making site changes in the spirit of accessibility won't result in a Google penalty or violation of Google's Webmaster Guidelines. John said on Twitter "I don't see a problem."
The initial reason he didn't see it as a problem is because he said "accessibility elements usually aren't the keywords you're trying to rank for." But even if they are keywords you are trying to ranking for, he said it would "certainly not a cause for a penalty."
Here are those tweets:
I don't see a problem, partially because the accessibility elements usually aren't the keywords you're trying to rank for. If they were the only mention of your main keywords on your pages, that would be trickier. Certainly not a cause for a penalty. Accessibile sites are great.
— 🧀 John 🧀 (@JohnMu) September 9, 2021
Then John was told, well, yes, the keywords may match words they want to rank for and he said "if it's also in your normal primary content, that's fine."
If it's also in your normal primary content, that's fine.
— 🧀 John 🧀 (@JohnMu) September 9, 2021
So in the name of accessibility, Google will give you the benefit of the doubt - probably. :)
Forum discussion at Twitter.