bash error in newly installed 12.3-RELEASE

From: Gary Aitken <freebsd_at_dreamchaser.org>
Date: Sat, 21 May 2022 21:15:23 UTC
In the process of upgrading from 11.4-RELEASE to 12.3-RELEASE

After upgrading the os, attempting to update packages

pkg-static upgrade -f
   managed to upgrade pkg ok,
   but on the next package, whose name is not displayed, I got something like
   <null> ..... (Y/n)?

So I did:
   portsnap fetch
   portsnap update
   pkg update bash
     This removed 32 pkgs, installed 5, upgraded 28, and reinstalled 6.

The reinstall appeared to work; I got a few messages about maybe wanting to
manually remove some files (unrelated, e.g. apache configs and python27) but
nothing else.

However, if I try to run bash, I get:

bash --version
ld-elf.so.1 Undefined symbol "rl_filename_rewrite_hook" referenced from COPY relocation in /usr/local/bin/bash

I then did
   pkg delete bash
which appeared to work, removing bash 5.1.16 and bash-completion 2.11.2.

followed by
   pkg install bash
which appeared to work, reinstalling 5.1.16

However, the error persists.

Ideas on how to proceed?

Thanks,

Gary