I have noticed that you are using somewhat judgmental language, "poor attention to detail," "errors," "faulty reports", and his religion "has not helped his attention to detail."
If you wish to avoid being viewed as discriminatory, and you wish to raise the question of religion (which may be its own HR minefield and you may not want to), you will need to avoid this sort of judgmental language in that context. Discrimination is all about judging someone's differences as wrong: so if you're judging them then you're going to be discriminating; if you're not judging them then you're not.
Per comments and downvotes, a discussion about how to constructively evaluate someone without judging them is coming across as heavy-handed on my part, and so there are other resources available for that on the web: whether understanding associated cognitive distortions you might create in employees, striving for transformational leadership, or knowing the costs of positional bargaining in negotiation, or framing yourself as a servant leader. I've heard similar things from the nonviolent-communication folks although I don't know their stuff nearly so well. But to summarize from the cognitive-behavioral side, the most important thing, I think, is to stop saying that things "just are" right or wrong, which involves labeling others out-of-context.
So this doesn't mean that you shouldn't label, but that you should try to be mindful of always attaching this context. His actions are not "bad", but rather "bad for me, because I want X, Y, Z, and I don't get any of those things from them."
Your employee accidentally left some bugs in the software without reviewing it first: and that sucks for you because they either got caught in review and you had to spend time managing those post-review steps, or else they didn't get caught in review and then the client or testing department sent an angry report about how the latest build doesn't work, and you had to spend time writing emails and deal with the egg-on-your-shirt shame of the encounter.
So it's not that the act of leaving these bugs in the commit was intrinsically wrong; we all make mistakes -- it just happened to have these negative impacts on you and you want to start a constructive discussion about how both of your desires can be fulfilled simultaneously, "here's what I need, please share what you need, then let's work together to figure out how we can both get what we need out of this professional relationship."
If you can connect to what your employee's needs and intrinsic motivations are, and understand him more as a person, then these religious needs are seen to be a part of that, and the whole tone of the discussion shifts. Once you have stopped judging their performance as 'bad' and imposing your authority upon the world, and shifted to understanding what's stressing them out and supporting and connecting with them, these religious matters can fade entirely out of the discussion.
So in your old mindset, the religious fasting was making them "worse" at their job. But from a different mindset, it has become another need which they have -- we all have spiritual needs of some form or another -- which you are mindful of. The discussion can be much more like,
"Hey, I don't know how this works with Ramadan, but I noticed you're upset that you're not getting enough sleep and talking about how you're lacking the energy to last the full day... do you need any help on the professional side to support those religious commitments?"
"What do you mean?"
"Well, I mean, I could split up one of your vacation days per week so that you get an extra hour of lunch break every day to recover your energy, or if you need to leave early for your religious services or something--those sorts of professional expectations can be shuffled a bit if it makes things easier."
"No, that's all right, but thanks for asking."
If you come at it from a suitable perspective, you're not going to offend anyone's religion, because you're actually supporting it. Where you go wrong is if you have this judgmental mindset, "your work right now sucks, and your religion is making your work suck more", and then suddenly you're in HR trouble because it is coming across as discriminatory, because that implication of "therefore your religion sucks" is very hard to avoid and may also be secretly what is in the back of your head.