All calls like the one you received are scams/phishing attempts. They are made by criminals that prey on the unwary. Apple never would make a call like this. Apple only calls if a user if the user has arranged the call.
And, there are things you can do to lessen the annoyance of such calls. For example, I hardy answer my land or iPhone any more. I only answer if caller ID or my contact list shows that I probably know the caller. Also, I figure that anyone that know me will leave a message if they have anything important to say and I don't answer.
And, if you want to, you can get a land-line system that you can use in blocking scam/spam calls. Also, I think this Apple document can be used to block scam calls as well as spam calls: Detect and block spam phone calls https://support.apple.com/en-us/HT207099