This is happening since your BO is sorting on the primary key of the table. Whenever you do an add, it is adding a new record with a "-1" primary key which, when sorted, gets immediately stripped out of the CurrentView.
The safest way to get around this is to disable your sort right before the add, then re-enable it right after.
bo1.Sort = "";
bo1.Add();
bo1.Sort = "CODE";
Alternatively, you could sort on something
other than the primary key, but even then you could get some funky behavior depending on what you choose to sort on.
The key here is that a sort or filter of a business object will be immediately applied whenever you add or remove a record, and, as such, any filters or sorts should always be taken into account when modifying the contents of the BO.
There a bunch of forum topics out there on this particular subject covering everything from alternative work arounds to why we do it this way, but that should at least point you in the right direction
.