You don't understand how the system is handling files.

You delete the file entry, but the file still exists as long as the program keeps an handle on it. So tee is never notified the entry was deleted and it still writes to the file !

A unique file can have many entries thanks to the hard links (created by the ln command).

You could write your own version of tee which close and open the file on every line it writes to the file, but it would be very under-performing as it would generate so many system calls.

Here is a shell-function which will split its input to several files :

    splitSizeInKio=100
    
    splitInput(){
        local PS4='+splitInput+ '
        set -x
    	local i=0
    	local fname="$1"
    	local ii
    
    	while true
    	do if [ $i -lt 10 ]
    	   then ii=0$i
    	   else ii=$i
    	   fi
    	   local outfile="$fname".$ii
    	   dd of="$outfile" bs=1024 count=$splitSizeInKio
    	   i=$((i+1))
    	done
    }

(You could use "head" instead of "dd" if you spilt on a number of lines instead of a size.)

With bash, you can use "process substitution" like this :

    prog1 | tee >( splitInput somefilename ) | prog2