It is kind of uncommon for me to see a head noun belong to a subordinate clause or phrase of a relative clause. I don't know if the usage is wrong or correct.
So, are the examples below grammatically correct? These examples are restrictive relative clauses I came up with (I don't know whether they are correct or not).
(1) This is a car which I sold my old stuff in order to buy.
(2) Knowledge which I solved this problem with was learned in school.
(3) The technology which I sent this file via is called email.