Helper function to cast Record value types. Valid casts are:
- scalar number -> scalar number
- complex number -> complex number
any
-> scalar number if the underlying value type is a scalar number
any
-> complex number if the value type is a complex number
any
-> string
if the value type is a string
- scalar number ->
any
- complex number ->
any
string
-> any