I often have this problem in a freshly created Proxmox pct container running Ubuntu 20.04. When I run a command with sudo I get this error.

sh
$ sudo ls
sudo: setrlimit(RLIMIT_CORE): Operation not permitted

This workaround has always worked for me.

sh
echo "Set disable_coredump false" >> /etc/sudo.conf