Is there an idiom which would convey
I'm afraid I can't do that
Literally translating, It would become
Ich fürchte, ich kann das nicht tun
Would that make sense?
One of the most common ways of saying this in German would be:
Das kann ich leider nicht tun.
Leider kann ich das nicht tun.
Your original sentence is correct, but perhaps not the most idiomatic: it reminds me of HAL 9000 from 2001: A Space Odyssey, although in reality the famous phrase "I'm afraid I can't do that, Dave" was simply rendered, "Das kann ich nicht tun, Dave" - take that as you will.