"I wanted to be a police officer but when I grew up I didn't want to."
Personally, I am confused about when you wanted and didn't want to. So I don't really know when these events took place. Try something like these: "When I was younger, I used to want to be a police officer, but now that I am grown, I no longer want to." ( I did when I was a child, but now I don't.)
Or maybe you mean: "I have recently wanted to become a police officer, but when I was growing up I didn't want to."
( I do now, but when I was a child I didn't.)
I hope that helps.