Bill Dance, the world renowned Bass Champion
says "yes, bass will stay in the area they are comfortable with".
Meaning: habitat, cover, food, structure, yada yada yada.
That is "one" of the reasons that the location of a professional
bass tournament is not given too far in advance as some
of the "unscrupulous" members may sneak some monster fish into
a specific area that they can fish later on during the tournament.
which, if it did work, would give them an unfair advantage above the others.
If you google the subject, many forums have different view points.
https://www.bassresource.com/bass-fishing-forums/topic/76998-do-fish-go-back-home-after-being-released/
is only one of them. - - - and it mentions a river.
If you want to catch a previously hooked fish, try "down river" and not
the same place or up river.
.