Is "layman" an offensive term?
"Layman" is a perfectly acceptable term. No one is an expert in every field. It refers to a person who is not an expert in the field. Very educated and accomplished people are laymen in fields not related to their own. For instance a neurosurgeon may know nothing about economics or paleo-botany and may ask: "Could you please describe that in layman's terms."
Say you're at an event and you hear something that you don't understand. "This GUID is not sufficient for our needs. We need to concatenate ..." No one would consider you, or a neurosurgeon, or a physicist incompetent for not knowing what a Globally Unique Identifier is. If, however, you're passing yourself over as a DBA (Database Administrator) or cyber-security expert and you don't know what a GUID is then you're opening yourself up for ridicule.
The word layman is most often used to contrast with expert or professional.
It might be offensive to a 'self-proclaimed' expert who lack the expertise or as @Josh indicates- unless you use it referring specifically to professional people.(experts)
Another way to use it is to distinguish between a member of the clergy — a priest or minister, for example — and an ordinary church member, or layman.