In your script you do not specific that you want to insert File to your field __Document. You need to choose that field in Insert File
I solved my own problem. This was a converted database from FM 12. There was a calculation field (type: container) of the externally stored container field. Big no no.