pathfinder 1e – Are there any instances of discussing the ethics (in Golarion) of finding alignment via alignment damage?

Not really sure how to word this, but I was wondering if there were any situations in an Adventure Path/Module/PFS Scenario/Source Book (PF 1e or 2e) that discusses using alignment damage to determine the alignment of a character? A situation came up in my game where my players met a stranger, and wanted to use Divine Lance to determine if the stranger was evil. They asked for consent from the stranger first (which, good on them), but that brought up an interesting question. Is this an normal ask within Golarion? Have there been other situations where alignment damage is used to determine the alignment of a person? Do the books cover this in any way? I had assumed most people would be kind of offended at the notion, but it hardly seems like my players would be the first people in Golarion to have had this idea, so it’d be nice to have a lore example.

(Something similar could be accomplished with Holy Smite in PF1, and probably a slew of other spells)