Your grep (likely GNU grep) detects that the file may not be text and instead of printing the matching lines, it only tells you there's a match to avoid printing what may just be garbage.
To bypass that and print it nonetheless, you can add the -a option (a GNU extension).
Also note that grep by default matches regular expressions (the re in grep), you need -F to find substrings.
Also, arguments to executed commands are public knowledge on a system, so you shouldn't pass a password or any sensitive data to grep as argument unless grep happens to be a built-in of your shell (very few shells have grep builtin though).
So instead, assuming a shell where printf is builtin (most these days):
printf '%s\n' "$password" | grep -anFf - /usr/share/wordlists/weakpass_3
Where:
-a: bypass the heuristic check for binary files
-F: Fixed string search instead of regular expression matching
-f -: takes the list of strings to search for from stdin (one per line)
-n: report line numbers