User IDs are not getting tracked when Application has multiple instances

We use matomo on-premise, And we recently found a problem. We have 2 instances of our application for two regions. USER IDs feature is not displaying any data for one instance and displaying for another instance. we are suspecting this might be due to matomo version difference because we are using different versions of piwik/matomo for two regions.

Application with piwik version 3.13.2 are displaying USER IDs data where as application with piwik version 4.10.1 is not displaying any data.

We assume USERIDs are implicitly tracked without any explicit tracking.