Found the source and a solution.
My FreeBSD jail was based on release 12.3.
I have created a new jail based on 13.5 and it worked fine.
I assume it could have been caused by an incompatibility with an older version, possibly due to some dependency.