Look for your “CARRIER_ID: XXX” which you can find when you put the phone into download mode (Power + Bixty + Vol down)
Once you have the 3 letter code that is the CSC (Sales / Region code). Use SamFirm ([https://forum.xda-developers.com/galaxy-tab-s/general/tool-samfirm-samsung-firmware-t2988647|Download from here]) to download the firmware. You can input the CSC code and Phone model (also listed as product name in download mode).
Flash that firmware, you’ll need to flash the non-home CSC to fix the lost imei and baseband so make sure you backup before flashing as non-home CSC will factory reset the phone upon flashing.