Update.
Have been through Apple on-line help who checked the hardware and said that all was OK. A software problem was suggested and a re-start from new was undertaken. The problem remained with erratic and sometimes large errors.
Next step - to the Genius Bar.
Problem demonstrated but Apple staff claimed they had not seen such a problem before. I suggested they tried an internet search which reveals widespread problems. Genius staff then lined up two IPhone 7s (running IOS 11) alongside my IPhone SE running IOS 10.3.3. All showed different and erroneous readings!
Genius staff said that IOS 10 and 11 did not use the magnetometer sensor which explains why a small magnet does not deflect the compass. IOS before 10 does seem to use the magnetometer sensor which would account for my earlier observation of seeing deflections by external small magnets on two IPhone SE phones in different shops that were still running on versions of IOS 9.
So what is going on? It seems to me that apple has some explaining to do but given my Genius bar experience they do not seem to be interested.
This is my first experience with Apple products and I have to say that I'm not impressed so far.