I have the same problem on one of my classic snaps as well. We tried upgrading the snap from core22 to core24 to pull in a newer ROCm driver version, but our Python-based snap hooks would break if we attempted to install the updated snap on earlier releases of Ubuntu.
In the end we had to revert back to core22 since we didn’t have the time to debug the issues with upgrading to core24. Here’s our open issue that contains a similar stacktrace: