The problem is in the first line of the script. Your form ID is the special ID that identifies the form. You can see it in the address of the form (it's the bit in bold)
docs.google.com/forms/d/17rxZ5vzy0OcxibXV6aRpso7Xm_Vs0FpxMLgbchjO998/viewform.
You accidentally used the form name instead.
That being said, I should have just used the Spreadsheet.getFormUrl() in the original answer. I'll change that now, then you won't have to worry about the ID at all.
In N3 I entered this formula:
=ArrayFormula({query(query({A3:D,value(B3:B)}, "select Col1, sum(Col5), count(Col4), sum(Col3) where Col1<>'' group by Col1 format sum(Col5) 'h:mm:ss'"),"select* offset 1",0), vlookup(query(query(query(A4:D, "select D, A, sum(C) group by A, D"), "select max(Col3), Col2 group by Col2 label max(Col3)''"), "select Col1")&unique(sort(filter(A4:A, len(A4:A)))), {query(query(A4:D, "select sum(C), A, D group by A, D"), "select Col1",0)&query(query(A4:D, "select sum(C), A, D group by A, D"), "select Col2",0),query(query(A4:D, "select sum(C), A, D group by A, D"), "select Col3",0)}, 2, 0)})
that seems to output the table you had as the expected output. Maybe someone comes up with something a little shorter (lol) but untill then.. make sure to test it thoroughly...
Best Answer
There are a lot of approaches you could take to this. Here's one (written as if your data is held in A:C on "Sheet1":
=ArrayFormula(QUERY(IFERROR(VLOOKUP(UNIQUE(Sheet1!B:B),QUERY({Sheet1!A:C},"Select Col2, Col3, Col1 Order By Col1 Desc"),{1, 2, 3},FALSE)),"Select Col3, Col1, Col2"))
Be sure to format your time column in the result range in accordance with the time column in your raw data range.
How it works (from the inside out):
The innermost QUERY takes the raw data and lists it in reverse order by time, leaving the most recent time at the top. It also swaps the order of the columns so that the name column is first:
QUERY({Sheet1!A:C},"Select Col2, Col3, Col1 Order By Col1 Desc")
The VLOOKUP searches only the UNIQUE entries among the names (limited each to one find), by looking in the QUERY range we just created in memory above. It returns all three columns of data (i.e., {1, 2, 3}). We use "FALSE" since the data is in no particular order by name.
UNIQUE includes one null value if contained in the range, and VLOOKUP will throw an error for a null search. So we wrap everything so far in IFERROR() to cut that one error.
We run another QUERY on our VLOOKUP results to put the columns back in the original order:
QUERY(...,"Select Col3, Col1, Col2")
Finally, everything is wrapped in "ArrayFormula," because we are retrieving results for an entire range, not just one cell.