I don’t see a FROM keyword. Hmm. I would expect something like this:
Select dates.generate_series as "date", shifts.generate_series as "shift"
From generate_series(..........) dates Outer Join generate_series(1, 3) shifts
You are putting your generate_series functions into the select list of the inner query. I didn’t think you could do that, except for the fact that postgres will attempt to execute the expression. The generate_series() function returns a table (set of rows) that has the single column “generate_series”. That you were getting anything seems to be almost accidental for how this function is supposed to be be used (in the FROM clause).
/*THIS IS WORKING! LIKE IN 9.6*/
SELECT a.datum, a.izmena, energijakosipoizmenah_new.dobri, energijakosipoizmenah_new.slabi, energijakosipoizmenah_new.porabaelektrike, energijakosipoizmenah_new.porabazraka
FROM (
SELECT b::date datum,
c izmena
FROM generate_series('2021-05-10'::date, '2021-05-17'::date,'1 day') b,
generate_series(1, 3) c
) a
LEFT OUTER JOIN energijakosipoizmenah_new ON a.datum = date(energijakosipoizmenah_new.datum) AND a.izmena = energijakosipoizmenah_new.izmena;