c# – Update existing key value if present and then deserialize json to POCO efficiently

I have a json string ProcessValue in which I need to extract a particular key (client_id) value and then I need to encode that value using HttpUtility.HtmlEncode and put it back in the same JSON string. ProcessValue is one of the header name which has a json value in it.

Below is my code which does that but I am deserializing twice looks like. Is there any way to improve below code?

ProcessValue = GetHeader(headers, PROCESS_DATA); // LINE A
if (!string.IsNullOrWhiteSpace(ProcessValue))
{
    dynamic jsonObject = Newtonsoft.Json.JsonConvert.DeserializeObject(ProcessValue);
    if (jsonObject.client_id != null)
    {
        var value = jsonObject.client_id;
        jsonObject.client_id = HttpUtility.HtmlEncode(value);
        var modifiedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObject);
        ProcessValue = modifiedJsonString;
    }
    ProcCustomer = DeserializeJson<ProcCustomer>(ProcessValue);
}

private T DeserializeJson<T>(string str) where T : new()
{
    try
    {
        return JsonSerializer.Deserialize<T>(str);
    }
    catch (Exception e)
    {
        return new T();
    }
}

Here ProcessValue at LINE A is:

{"key1":"value1","key2":"value2","key3":"value3","key4":"value4","key5":"value6","client_id":"Hänzendes"}

I am extracting client_id value and then encoding it and after that putting it back to same json. And then I am deserializing this modified json value to ProcCustomer POCO. ProcCustomer is the POCO class which holds all the fields value. So I am deserializing and serializing to get my updated json string ProcessValue and then I deserialize this json to ProcCustomer POCO class.

There are places where we use ProcessValue json string directly as it is one of the header value and using ProcCustomer POCO fields as well so that is why I was doing above things. I wanted to see if there is anything I can do to optimize my above code where I don’t have to deserialize and then serialize and then again deserialize to put it in POCO?

Also I am mixing Utf8Json library with Newton json library. I prefer to use Utf8 json library for both serialization and deserialization in my above code.