Here is what is going on. list contains a reference to l. So when you clear l, you clear the one you added to list. But the reference is still there to accept new values.
ArrayList<ArrayList<Integer>> list = new ArrayList<>();
int i=0;
ArrayList<Integer> l = new ArrayList<>();
l.add(1);
l.add(4);
list.add(i,l);
i++;
l.clear(); // you just deleted all the contents of list `l` but not the list `l` itself.
l.add(0);
l.add(4);
l.add(3);
l.add(2); // now list `l` (the reference still in `list` contains 0,4,3,2
list.add(i,l); // and now list contains the same reference yet again so you get
System.out.println(list);
prints
[[0, 4, 3, 2], [0, 4, 3, 2]]
And note that if you do this, list.get(0).set(1,99) will affect both lists because each List l in List list is a reference to the same list.
[[0, 99, 3, 2], [0, 99, 3, 2]]