"Yesterday I learned that my lawyer loves me."
Translation:Ik heb gisteren geleerd dat mijn advocaat van mij houdt.
It's a valid translation, though literally the word 'ontdekte' would mean 'discovered'.
Your translation as well as this one "Gisteren kwam ik er achter dat mijn advocaat van mij houdt." would actually be used in real life, while the preferred translation "Gisteren leerde ik dat mijn advocaat van mij houdt" probably wouldn't.
(Same discussion from another sentence:) The tenses between the translation and the original do not match. "Ik heb geleerd" = "I have learned", while "I learned" = "ik leerde". Even though it sounds like a common translation, I'm not sure it should be the correct one. Or at least alternatives where the tenses match should be added.
In English, the simple past is used when a specific time (eg "yesterday") is given in the sentence denoting a finished action. I assume Dutch doesn't have such restrictions. So for this sentence, an exact present perfect translation into English would be improper (unless "yesterday" was removed).