CASSANDRA-18739 describes a reproducible NPE on restart with some UDFs. The solution outlined in that ticket was not used and a much simpler solution provided by Stefan Miklosovic was implemented. There are 2 pull requests open for Cassandra 4.0 and 4.1 that have the fairly simple fix as well as a test case to show that there was a problem and that the fix works.
Can someone take a look at the issue and pull requests. Stefan is working on a solution for v5 that we may want to get in ASAP. v4.0 - https://github.com/apache/cassandra/pull/2584 v4.1 - https://github.com/apache/cassandra/pull/2585 Thank you, Claude