This can be seen in DebuggerTests.ArrayTests.InvalidArrayId, which gets an assertion:
console.error: * Assertion at /workspaces/runtime/src/mono/mono/metadata/class.c:4580, condition ' not met`
mono_array_element_size (MonoClass *ac)
{
g_assert (m_class_get_rank (ac));
We should validate validate whether a given object is an array or not, before calling into these functions.