Global JsonObject (ArduinoJson)
jsonBuffer is local to the function. When you leave the function the contents of jsonBuffer are lost. 

functions just points to the internals of jsonBuffer to get its data (to save memory).

You can either:


Make the jsonBuffer global so it sticks around all the time, or
Have a secondary DynamicJsonDocument or StaticJsonDocument that is global to which you copy your objects once read from jsonBuffer.