For me problem was groovy script, which set parameter id as string if not specified:
def params = utils.queries.params().put("id", personId).getMap()
so this helped:
def params = utils.queries.params().put("id", personId as Long).getMap()