currentUser: Impossible to invoke a method ("isInGroup") on a null variable
Yes, that's expected behavior.  currentUser will not exist if there is not a currently logged in user.

{% if currentUser.isInGroup('verified') is defined %}


That's one workaround for it.

Another would be:

{%if currentUser is defined and currentUser.isInGroup('verified') %}


which to me reads a little better even though it's more verbose.