I was confused by the overload definition. If the input is Record type, the key of the output is always string.
From source:
/*
* NOTE: when the `input` value is a simple Record<K, V> object, the keys are extracted with
* Object.keys(). This means that even if the `input` type is Record<number, V> the keys are
* compared/returned as `string`s.
*/