“We had a shortage last night of beds for babies,” one official wrote as migrant children were being separated from their mothers as early as 2017.