I did some quick research on the POSIX thing and it looks like cd (without parameters) is defined in POSIX:
https://www.unix.com/man-page/posix/1posix/cd/
Also I don’t know why many of my posts keep getting downvoted even when they’re factually accurate.
I’m guessing (though admittedly not checked) that both ~ and cd (without parameters) are defined in POSIX. In which case any edge case that doesn’t conform could reasonably be discounted with regards to the submission’s exercise.