I found the issue, from the whole time I defined entity type wrong, missed to add parenthesis at the end.
const recordConfig = entityConfig({ collection: 'records', entity: type<Record>(), selectId: (record) => record().pid, });