For what I know from personal experience, experience from friends, and from discussion on forums and sites like this one, the shoes are one of the many things about bike equipment about what the answer to the question is "whatever suits you best".
It is very common for riders to use a lot of very different shoes: sandals for grocery, regular shoes for commuting to work, clipless for trails or long distance, fast rides, and so on.
From what you said, I'd suspect:
- Your bike setup, specifically saddle height, saddle position (fore-aft and tilt), and/or handlebar reach could be "wrong" for you;
- You are riding too much, or too hard, or without proper rest, or in the wrong gear, or in a bad terrain CONSIDERING that you started to bike for just four months now. Muscles and cardio usually get strong fast, but joints, bones and tendons take more time, so they can having been overused;
In any case, I'd suggest you assess the situation by yourself and alter some of these things before blaming the shoes. If it doesn't solve the problem in some weeks, look for a doctor.
Hope this helps!