At typical corporation, something like a Chief Ethics and Compliance Officer (CECO) would be largely focused on legal compliance - making sure company personnel aren't engaged in bribery, fraud, insider trading etc. The value of this role (and the medical example) is to prevent lawsuits and/or prosecution.
For a company like Meta, an ethicist is likely concerned with the inherent ethical concerns of running a social media company, which impacts the mental health of its users, many of whom are minors. For AI companies, the ethics of releasing models that are capable of doing dangerous things. In name, the job probably involves giving recommendations about how to ethically implement features in the platform to minimize harm. In practice, the job probably accomplishes very little.
I think a lot of it depends on the size of the company. Startup? Sure, maybe it's a real thing.
Gigantic company like a member of FAANG or MANGOS? absolutely a PR move.
I can't disagree with that, reminds me of the quote from the movie Rounders: If you've been at the table for 30 minutes and you don't know who the sucker is, you ARE the sucker.