NEWS, bash-5.1, item 1.o. says:
o. Bash posix mode now treats assignment statements preceding shell function
definitions the same as in its default mode, since POSIX has changed and
no longer requires those assignments to persist after the function returns
(POSIX interp 654).
This refers to the following POSIX change, I guess:
https://www.austingroupbugs.net/view.php?id=654
IMHO the wording "preceding shell function definitions" is misleading,
because the assignment precedes the function call, not its definition.