As far as I am aware, there is absolutely nothing about the definition of a Class II item which prevents a connection to earth being present within it (or, as in this case, "used" within it)..... not sure how they can be class II when it needs an earth to work? ...
Class II is all about protection of people outside of the item from whatever may be inside it - it does not restrict what can be inside it.
Kind Regards, John