You may note that when uploading an apk/aab signed with KeyA (your key, the same key you're using for firebase, also called upload key), then Google sign your app with the auto-generated key (KeyB, also called signing key) before distributing to user.
So you must add KeyB to your firebase too (go Play dashboard -> app signing -> you'll find out KeyB) to make feature work correctly
If you would like to use the same key, you can choose not to opt in to Play App Signing (but only for apps created before August 2021), more details here