The parentheses are misplaced:
SELECT setval('payments_id_seq', 21, true); -- next value will be 22
Otherwise you’re calling setval
with a single argument, while it requires two or three.
This is the same as SELECT setval('payments_id_seq', 21)