Tjomme
Databricks Partner

Same issue here. Tested on shared clusters up to the latest DBR version 13.1. All give the same error:

py4j.security.Py4JSecurityException: Method public java.lang.String com.databricks.backend.common.rpc.CommandContext.toJson() is not whitelisted on class class com.databricks.backend.common.rpc.CommandContext

With a Single user cluster there are no issues

Related question: https://community.databricks.com/s/question/0D58Y00009DDCPOSA5/getcontext-in-dbutilsnotebook-not-wor...