// are required by law to take an oath of allegiance to the Crown.//
that is the law about 1880 - see Chas Bradlaugh - he wdnt swear
https://en.wikipedia.org/wiki/Oaths_Act_1888
You MAY say even if you affirm it is still an oath
(words) - Quakers and Brethren may disagree ( they affirm but they dont swear, )
The wording of the oath used to be designed to filter out Romans(*) - and was changed to allow a Roman to become Lord Chancellor - he didnt ( make it)
( "I swear by lamighty god to uphold the laws of england and whoop the Bishop of Rome whenever I can.....""
Romans of course saying - I cant swear that ! - they take it seriously they do)