Here "gone astray in their hearts" is a metaphor for not being loyal to God. Here "hearts" is a metonym for minds or desires. Alternate translation: "They have always rejected me" or "They have always refused to obey me" (See: [[rc://en/ta/man/jit/figs-metaphor]] and [[rc://en/ta/man/jit/figs-metonymy]])
This speaks of a manner of conducting one's life as if it were a way or a path. Alternate translation: "They have not understood how I want them to conduct their lives" (See: [[rc://en/ta/man/jit/figs-metaphor]])