Why is the 了 here after 错 not after 投? The agent says the customer should insure all risks, he wants normal insurance. 

Agent: 万一货物出了问题，就有可能因为投错了险而无法得到赔偿，那麻烦就大了。

I imagine '投了险' is short for '投保了保险' and I thought '错‘ is an adjective for ‘险’ (= take out 了 (the wrong) insurance), such that I really have '投保了错的保险’. But 外语教学与研究出版社, FLTRP, in their wisdom have written '投错了险'.

Can I push the 了 back a space and write '投了错的险‘, or is 投错 somehow a word??
“投错了险” is an informal expression.
It is generated from the phrase: "买保险“.
the evolution chain: "买保险” →“买错保险”（negative form，“错”here is a "verbal complimentary", which showing the result of an action "买”。）→“买错了保险”加上了tense particle “了”→“买” can be accepted when to be replaced by "投” in a context of a casual email. "保” of “保险” can be omitted too in this context.
"le" has to be put after "complimentary". So, 投了错的险 is wrong.
why people use ＂投” instead of "买”？ In recent years, more and more people changed idea of buying insurance for accidents to a type of investment. And "investment" in Chinese is “投资”。 So some people say "投保险“。—— I personally don't like it. This just shows how people become careless about the use of words instead of using innovative new words.