To directly answer your question, here are some statistics.
This childproofing checklist seems about right to me in terms of age. 3-5yo are old enough to usually not swallow things inappropriately, depending on the child, but not to always behave in that regard. So I'd set a minimum age target of 5; and I'd point out that children develop differently, so even above 5 you're going to have some things you don't want them to handle (for example, you wouldn't put a gun on this shelf, right?). However, above 5 you're at the point where if they want to get to a high shelf, they will know how to move stools/chairs around to get to it, so it's pointless to worry about height alone then.
According to the WHO height for age chart, a five year old boy can be nearly 120cm (97th percentile). If you and your partner are particularly tall, I'd consider even taller possible, as I know someone well above the 97th percentiles (with 2 parents nearly 2 meters tall each), but let's start with that. 120cm high, and then add in another 40% for reach, means a minimum of 170 cm high to be above the reach of the child.
The best reference I could find was this reference from Victoria, Australia, which states:
Store medicines and dangerous household products in cabinets or cupboards with a child-resistant lock at least 1.5 m above the ground.
1.5m is probably above the reach of most children until around 5, and it's certainly out of their eyesight, though I'd consider 1.7m safer particularly if you can expect tall children. I agree with the suggestion to do both (high and childproof locked), if at all possible. My children were climbers, and early on knew how to get to quite high spaces - particularly in the bathroom, which is eminently climbable (on the toilet, on the sink, etc.) They saw us putting things up above the bathroom cabinet (in our case, never anything dangerous, just we didn't have space for it lower) and would climb on the sink to get to it. Don't assume that anything in the bathroom is unquestionably out of reach.
Another thing to consider: a 12cm shelf is quite narrow for many cleaning supplies. Even if your supplies are within that 12cm (obviously you can limit to buying ones under that), you're going to be building something that may eventually develop a bit of a lean - so you'll want to put a lip on it, taking up a cm or so, just as a door would. And you're still taking the risk something topples off if you've overcrowded the shelf - or if your child bumps into it with a stick or something.
The best place for cleaning supplies is not in the bathroom (a room your child spends lots of time in), but in another location. Obviously not everyone has another location, but think long and hard about if there is anywhere else you can put the dangerous ones. And if there's not, an inexpensive cabinet with doors that latch would be much safer than solely a shelf.
Finally, one other thing you can do to mitigate risks is to involve your child with cleaning the bathroom from as young an age as possible. My (now 6) year old was cleaning the bathroom at 5, including using some cleaning products (like toilet bowl cleaner) that aren't safe for him to consume. Teaching him the safety aspects of cleaning the bathroom was important to us, because that way he learned how to behave around the cleaning supplies. Even though we still believed that a 5 year old isn't going to be perfect with that sort of thing (and thus we shouldn't consider it safe at that age), teaching him to use them and to follow precautions (like gloves, safety goggles, an apron or cover-shirt, closing the nozzle or bottle when putting it down, not spraying towards people) meant it was more likely that if he did encounter the items that he would act more carefully and safely when he did.