Thanks @areusch .
This is indeed a bug. The cause of the matter was due to the fact that we specially handle NDArray serialization, but did not handle the case where the typing in c++ is ObjectRef(while the value itself should be NDArray).
It had not been a problem since before NDArray was not part of Object. But it appears as a bug after we unify the NDArray as a subclass of Object(and such possibility appears).
Fixing it would involve updating the serialization mechanism of ObjectRef to specifically handle NDArray(and Optional is not an issue here). Will dig a bit and get a resolution soon