Parsing JSON and "reformatting" it

Hello!
Im trying to make a weather station. For this purpose I use ESP32 and parse weather forecast from https://openweathermap.org. The problem is that the response is too large and I dont want to spend so much memory on it, so I decided to parse it and save only the things I need. First of all I save only the data of times of the day I need (6am, 12am, 6pm).

DynamicJsonDocument large(18000);    //Parsed response for 3day 3hour forecast
DynamicJsonDocument onlyCorrectTime(3000);   //JSON with only the needed times of the day
DeserializationError error = deserializeJson(large, http.getString());    //Deserialize JSON from GET-Response (works well)
http.end();
if(error){ Serial.println(error.c_str()); fail = true;}
else{
  byte cnt = 0; //Index in new json array
  for(int i = 0; i <= 23; i++){ //Through all elements in whole response
    if(strstr(&large["list"][i]["dt_txt"].as<char*>()[11], "06") || strstr(&large["list"][i]["dt_txt"].as<char*>()[11], "12") || strstr(&large["list"][i]["dt_txt"].as<char*>()[11], "18")){  //Get only 06, 12, 18Hrs forecast
    onlyCorrectTime[cnt]["temp"] = large["list"][i]["main"]["temp"];
    onlyCorrectTime[cnt]["sky"] = large["list"][i]["weather"][0]["main"]; //Sky state
    onlyCorrectTime[cnt]["icon"] = large["list"][i]["weather"][0]["icon"];  //Icon name to display
    onlyCorrectTime[cnt]["time"] = &large["list"][i]["dt_txt"].as<char*>()[11]; //Only the time with no date
    cnt++;
    }
  }

This part of the code works well, but if there are ways to make it quicker and smaller - please tell me

Then Im trying to “reformat” the JSON, so it looks like this:

{[{"temp": 24.4, "sky": "Clear", "icon": "01d"}, {"temp": 20.4, "sky": "Clear", "icon": "01d"}, {"temp": 16.0, "sky": "Clear", "icon": "01d"}], [{"temp": 24.4, "sky": "Clear", "icon": "01d"}, {"temp": 20.4, "sky": "Clear", "icon": "01d"}, {"temp": 16.0, "sky": "Clear", "icon": "01d"}]...}

Each element with elements represents a single day with data at 6, 12 and 18 o’clock. The problem is that this part of code is definitely incorrect, takes much space, runs slow and takes much memory. +it gives me some error I dont understand:

error: 'const class ArduinoJson6151_0000010::ElementProxy<ArduinoJson6151_0000010::JsonDocument&>' has no member named 'getOrAddElement'

The second part of the code looks following:

byte perday;    //Data per day
byte current = 0;    //Current measurement per day
cnt = 0;    //Day counter
if(strstr(&onlyCorrectTime["list"][0]["dt_txt"].as<char*>()[11], "06")) perday = 3;   //If data of the first day starts from 6am, write all 3 measurements to JSON
else if(strstr(&onlyCorrectTime["list"][0]["dt_txt"].as<char*>()[11], "12")) perday = 2;    //If from 12am, only 2, because 6am is not available
else perday = 1;    //If only 6pm, write only 1 element to the first day
for(int i = 0; i <= 8; i++){
  if(current == perday){    //If current data is the maximum, that is allowed per day
    perday = 3;
    current = 0;    //Current back to 0 (next day begins)
    cnt++;    //Switch to the next day
  }
  weather[cnt][current]["temp"] = onlyCorrectTime[i]["temp"].as<double>();
  weather[cnt][current]["sky"] = onlyCorrectTime[i]["sky"].as<char*>();
  weather[cnt][current]["icon"] = onlyCorrectTime[i]["icon"].as<char*>();
  current++;
}

Please, help me to make the code look better and bring it to work! My mind is exploding, I dont know how to make it better