It's not "of course", if there is no 5th amendment protection then you can be forced to give the passcode. The New Jersey case the article mentions is about exactly that. [https://law.justia.com/cases/new-jersey/supreme-court/2020/a...]
My “of course” comment above was about refusing police questioning (Miranda rights). not refusing a search warrant. That does seem like a much trickier issue.
Edit: added the clarification about Miranda rights
> At some point thereafter, the officers obtained a search warrant for the contents of Valdez’s phone. But they were unable to access the phone’s contents because they could not crack his passcode. So a detective approached Valdez, informed him that he had a warrant for the contents of the cell phone, and asked Valdez to provide his passcode. Valdez refused. Without the passcode, the police were never able to unlock the phone to search its contents