Solved my problems as follow:
instead of passing the SID to the GroupPrincipal I just passed the groupName like this:
public bool IsUserInGroup(string groupName)
{
PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
GroupPrincipal group = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, groupName);
if (group == null)
return false;
return true;
}