Fix a Vault kv_ v2 error
#38535 (closed) describes a scenario where a vault key exists, but the secret has been marked deleted and appears as nil data in the the kv_v2 engine. In this case the engine panics because it can't coerce nil to a map[string]any. Handle this case explicitly and return an error instead of panicing.
Also, if the secret data exists but cannot be coerced to a map[string]any, return an error instead of panicing.
Fixes Error message for Vault secrets versions marked... (#38535 - closed)
Edited by Axel von Bertoldi