jk rowling has had severe ocd so i wouldnt be surprised if this was an intentional thing   to those saying its a mental compulsion definitely  mentally saying the word ridiculous would be i think its more a reframe of a classic mindfulness technique of noticing your thoughts and then redirecting your attention