Do you mean:
conn.ltrim(:failed, 1, Sidekiq.failures_max_count) instead conn.ltrim(:failed, (-Sidekiq.failures_max_count), -1) ?