sql – CROSSTAB with PIVOT

This is what my data looks like –

id  type  entity  diag  count
9   SER   ORG     a     18
9   SER   ORG     b     5
9   SER   PRAC    b     50

When I run this query –

select *
    FROM CROSSTAB($$
    SELECT
        id, type, entity,
        diag,
        count
    FROM calc
    $$, $$
    SELECT
       name
    FROM diagnosis
    ORDER by name
    LIMIT 3
$$) AS pivot (
    id INT,
    type  TEXT,
    entity INT, 
    a INT, b INT, c int
);

The output is –

id  type  entity  a  b
9   SER   ORG     18 5

What happened to the last record in the input?

I would expect this output –

id  type  entity  a  b
9   SER   ORG     18 5
9   SER   PRAC       50