This was a fun one - but be warned my stab of an answer is about as precise as a nine-pound hammer and a rubber nail...(the last time I actually did any vertical analysis was when I was half my current age, at the tail-end of the 14th second of all that UG stuff ;)
If by "grammatical" you mean to ask if it violates usage according to standardization, i.e. writer-reader-publisher friendly, then no, it's not grammatical as any editor worth her salt would revise it. Clunky begets clunky. However, in natural language usage - not always what is argued for and encouraged here in this forum, depending on who's in on the conversation - there is evidence that violations do occur in English, naturally. (I call it "real-time" grammar; a more relevant measure of usage fluency.)
1) Here's how my brain wants to add to it, un-gap then re-read, and re-arrange it:
"He made a useless system out of what could have been a revolutionary invention, if it had been developed by a better programmer."
(I know, way too verbagey and not the haiku it longs to be...)
2) From there, I followed the comments on each of the variations you provide above; there is discontinuity, extraposition, and at least a few gaps...I particularly enjoyed the links added by John Lawler. But your question is specific to "discontinuous" or "gap" with apostive and antecedent:
3) From what I could find, these are not ungrammatical, as analyzed by practitioners dealing with natural usage utterances. The example from the first source below, that I think parallels yours well, deals with parasitic gaps.
Culicover, Peter W. "Syntactic change in the Parallel Architecture: The case of parasitic gaps."
- "A striking fact that the investigation of P-gaps in Culicover and Postal (2001) made very clear was that ... some languages, like English and Swedish, allow P-gaps in a wide variety of syntactic contexts..." As in: "We found out which talk everyone listened to failed to understand."
There's more descriptive notation, detailed categorizing, and even a hierarchy of this gapping that you might find helpful in some of the more recent literature. Another source you might try is: "Parasitic Gaps in restrictive and appositive clauses" by Stanley Dubinsky. University of South Carolina. (http://linguistics.huji.ac.il/IATL/22/Dubinsky.pdf)
The next interesting piece I found deals with the "discontinuity" question, and the issue of the constituent that Greg Lee commented on.
- "Discontinuous Constituency"
Ed. Harry Bunt and Arthur van Horck - January 1, 1996
Walter de Gruyter - Publisher
I could only find a googlebook copy of this on my iPad, but if you check out Page 69, there are some examples that show gaps and discontinuity in vertical form; he calls them "DISCOTREES and SUBDISCOTREES". Way fun.
Again, the question I keep coming back to is what you are asking when you ask "grammatical?" In your response to Adam Hayes you express an answer that can specify usage. There's much work and more to be done, but evidence of usage is out there. I hope you find your answer!
p.s. 2b is my favorite; it sounds especially good if you imagine listening to it with Carl Sagan as narrator...the next sentence would have to lead to some kind of poetic redemption, no?