Might have to contact your carrier it could be a software bug that's causing your phone to act up because word is the new est Samsung flag ship phones have been experiencing slot of bugs due to new one ui pie update
See the issue is actually pretty simple. Your data is inaccessible while on phone calls because your mobile data it working on give you a quality call cause 75% of people that are in a phone call don't use other apps while in the call. Now a good way around that connect to wifi and you can use other apps while in a call but other than that that's it
I know it's an old post but...swapping Sims isn't the solution. Dual SIM phones can have data/internet only from sim1 or sim2. If you checked mobile data on sim1 and receive a call on sim2 it's normal for the internet not to work because during the call sim1 is deactivated. You can use only a sim at a time. So change your data on the sim that u use most.