Problems with autoSizeColumns – some cells are still too small

I am writing data between excel sheets. some sheets are taken from the original excel, some sheets are written new. I am having trouble with fitting the columns to the correct size, so all data is visible.

my code

public void autoSizeColumns(Workbook workbook) {
    int numberOfSheets = workbook.getNumberOfSheets();
    for (int i = 0; i < numberOfSheets; i++) {
        Sheet sheet = workbook.getSheetAt(i);
        if (sheet.getPhysicalNumberOfRows() > 0) {

            //Find a row that has entries for all columns 
            // because resizing on empty cell doesn't work correctly
            Iterator<Row> rowIterator = sheet.rowIterator();
            int maxCells = 0;
            Row rowWithMaxCells = null;
            while (rowIterator.hasNext()) {
                Row row = rowIterator.next();
                if(row.getPhysicalNumberOfCells() > maxCells || rowWithMaxCells == null ){
                    maxCells = row.getPhysicalNumberOfCells();
                    rowWithMaxCells = row;
                }
            }

            // calculate column width
            Iterator<Cell> cellIterator = rowWithMaxCells.cellIterator();
            while (cellIterator.hasNext()) {
                Cell cell = cellIterator.next();
                int columnIndex = cell.getColumnIndex();
                sheet.autoSizeColumn(columnIndex);
            }
            }
        }
    }

i’m calling the function just before writing the workbook to an outputstream

i am aware there are similar questions on SO, but didn’t find an answer that worked for me.

EDIT: since some answers to similar questions mention problems with the used font:
most of the tables use Arial

EDIT: I noticed that this part of the code

        //Find a row that has entries for all columns 
        // because resizing on empty cell doesn't work correctly
        Iterator<Row> rowIterator = sheet.rowIterator();
        int maxCells = 0;
        Row rowWithMaxCells = null;
        while (rowIterator.hasNext()) {
            Row row = rowIterator.next();
            if(row.getPhysicalNumberOfCells() > maxCells || rowWithMaxCells == null ){
                maxCells = row.getPhysicalNumberOfCells();
                rowWithMaxCells = row;
            }
        }

always selects the header of the table, because its the first row, which has all colums filled.
some columns are still longer than the header row, so this doesn’t seem to be the problem