The first amendment absolutely can protect from a charge of trespassing, or from any other charge. We don't know if it will in this particular scenario, but speaking categorically? Yes, it can absolutely.
A recent high profile example of trespass law clashing with the first amendment would be free speech zones.
The Constitution constrains the construction and application of all laws. Every single one.