Thank you for your shot at explaining the questions! Perhaps it'd help to put down the whole question:
다음 밑줄 친 부분이 틀린 것을 고르십시오.
1.
① 그는 사전이 왜 필요하다고 했다.
② 소포는 3일 후에 도착할 거라고 했다.
③ 친구는 졸업 후에도 연락하며 지내자고 했다.
④ 병원에서 식사를 한 후에 약을 먹으라고 했다.
(Ans is 4)
2.
① 벽에 걸어 놓은 그림이 갑자기 떨어졌다.
② 아까부터 내 옆에 앉고 있던 사람이 말을 걸었다.
③ 5년 동안 함께 일해 온 동료가 회사를 그만두었다.
④ 첫인상은 무서웠지만 만나 보니 친절한 사람이었다.
(Ans is 2)
Of course more information is always better.
In the first example -- what I find wrong with sentence 4, looking at it from an English grammar perspective, is that there is no match between performer and action: "(병원)에서" is not a performer for the action "했다" (in this case 'said' rather than 'did'), however, in sentence 2 the implied performer is also left ambiguous in typical Korean style. So it may be that also the performer is similarly implied in sentence 4. I see it like saying 'They told me at the hospital that I should take this medicine after meals.
Apart from "hospital" this sentence would read "~~ said to take the medication after meals" "~~ 식사를 한 후에 약을 먹으라고 했다." so if we substitute a suitable performer such as 'the doctor' instead of 'hospital' we get "The doctor said to take the medication after meals" or 의사 선생님이 식사를 한 후에 약을 먹으라고 했다. Anyway I just don't see anything wrong with 먹으라고 했다 ..but one could also say 복용하라고 했다 with regard to medicine.
In the second example I'll let the previous comments ride until the experts show up. I will attempt to consult with one such expert in a few minutes and hopefully amend my comments
*********
Now after all that, my native expert* (*Native Korean citizen of 전라도 광주, university graduate, 40+, and fluent English) has told me that there is nothing wrong with sentence 4, that in fact it is sentence 1 that is wrong because it reads as a statement when it should actually read as an indirect question, so that #1 should read 그는 사전이 왜 필요하
냐고 했다. more specifically, because "왜" is in the sentence.
...and my expert agrees that in the second example it should read 앉
아 있던 the reasoning she gave behind this is that while it might be acceptable to use the pattern ~고 있던 in other situations (e.g. 먹고 있던, 가고 있던) the pattern '앉고' is awkward and in speech leads to confusion with '안다' (hug)