I am presuming you work in either retail or hospitality and that the management you speak of are barely out of their teenage years
I could be wrong, but I did my time as a pizza delivery driver many moons ago where the managers were paid barely a little more than the regular staff, but had a notable increase in responsibilities.
Some responsibilities that they did not like — such as when Staff no-showed and there was no cover — it was their obligation to cover.
When certain staff members (who were notorious for being flaky workers) would call in, the managers would pressure them to come in, and do just about everything they could to make sure they did not have to cover their shift.
And this is where I think they are angry. I am willing to bet that the company policy for calling in sick is to phone in to report. Probably does not require them to actually speak to a manager.
So, you being bright-eyed and bushy tailed, answered the phone, took the message, passed the message on, and now they have to work.
To be clear at this point, you did nothing wrong if my suspicions are correct. Your managers are the problem
The way to handle this?
Asking for them to document in writing how you should have handled it so that you know for next time
Hey boss, so that I can better help next time someone calls in sick,
you asked me a number of questions that I did not have the answer to
as person didn't tell me. Can you put the policy and procedure of what
to do when someone calls in sick, in writing, so I can reference it
next time?
If the questions they are asking are invasive (and I suspect they are) they will absolutely not want to put it in writing, because what they are asking is probably illegal, you can have further fun with this by emailing them and saying as per our conversation, you would like clarity on what is expected.
That way, if it happens again, if you have no written process or procedure and they give you a hard time, you go to HR that you asked for a process, didn't get one and are getting in trouble again (bonus points for mentioning hostile work environment, HR loves a lawsuit). If you do have a written process, you make sure you do everything in the process and if they grill you about it, as above, you go to HR, indicate you followed the process but still got yelled at.
Back yourself, get everything in writing - it is the only way to deal with people like this - and once you learn the rules of the game - it is most fun to play.