This question already has an answer here:
Search for username substring in pwd string
There are two things, what you search for, and what you search in. You're mixing the two in your examples.
if [[ "$USER_NAME" == *"$PWD"* ]]; then ^------swap----^
And this greps in the file named by the contents of
PWD clearly won't work, because
PWD is a directory, not a file:
grep "$USER_NAME" "$PWD"