I have an 09 sti. I know what the codes are for

P0024- camshaft position- timing over advanced
P0172- bank 1 too rich

My question is a general one, if it's serious, after it was cleared it would come back on correct or not? It was in limp mode upon those codes coming on. Cleared them it hasn't came back on.

I'm sure P0024 is causing P0172. What could be the problem.