Perhaps the second call to ```cube.coord()``` should be a loop over all matching coords e.g.
```python
for cube_time_coord in cube.coords(coord.name()):
   #...
```
given there can be multiple coords with the same name. I'd also take the ```coord.name()``` out and assign it to a variable before all the looping, but that's a personal thing. FWIW I'm with @ajdawson - far too much in a try.