In web development, what common programming error leads to the runtime issue where "cannot set headers after they are sent to the client" occurs?
A) Cross-site scripting (XSS)
B) Asynchronous JavaScript and XML (AJAX) handling
C) Race condition in multi-threaded environments
D) Attempting to modify response headers after sending HTTP headers