To set the end of a marker you have to provide seconds as a number but the output of marker.end is a Time object.
So it would be right to set:
marker.end = 12.7
But this would fail:
marker.end = marker.end
Instead this is right:
marker.end = marker.end.seconds