The json is a snapshot at a point in time; it has information that dump1090 considers currently valid. If no ident has been heard for a while, there is no ident in the json.
The web interface aggregates data over many snapshots. If there was an ident available at some point in the past, but then the json stopped including it, the web interface keeps the old value.