Can I somehow group insert returnings?
Use another CTE for the second INSERT and SELECT DISTINCT user_id FROM that CTE. In the new CTE do an INSERT ... SELECT FROM the old CTE.

WITH inserted_user
AS
(
INSERT INTO "user"
            (username,
             password,
             nickname,
             account_non_expired, 
             account_non_locked,
             credentials_non_expired,
             enabled)
            VALUES ('username',
                    'password-hash',
                    'nickanme',
                    true,
                    true,
                    true,
                    true)
            RETURNING id
),
inserted_user_role
AS
(
INSERT INTO user_role
            SELECT iu.id,
                   gs.n
                   FROM inserted_user iu
                        CROSS JOIN generate_series(2, 4) gs(n)
            RETURNING user_id
)
SELECT DISTINCT
       user_id
       FROM inserted_user_role;