So hopefully you now see what it was you were doing wrong as all the last posts are directing you in so many words to the same place.
Your monitoring set up is flexible so it's easy to get this wrong.
Middle man got me thinking that what I would do is use the headphone system on the brain and route the computer playback from my audio interface into the AUX in jacks. They put them there so you could play along with a CD or MP3 player.
Then as we are all saying, record the MIDI output and carry on.
I would quantize the new MIDI track to the appropriate resolution to line it up. That's what I do with drums input from my keyboard. Same thing.
If you actually like the sound of the TD9 brain,or even just one of the sounds, then I would still record with MIDI and run the TD9 as a outboard synth. You record the MIDI, edit and enhance then play it via MIDI to the TD9 and record the Audio output as it is played back from the MIDI track. You could via MIDI editing record just the Kick or Snare etc.