1st Kings 6:23-28The commandments in the catechetical formula are simplified from the Biblical text to help with memorization. The Catholic Catechism is clear that idolatry is a sin against the First Commandment (see CCC 2112 to 2114).
The prohibition you quote is not against simply making them, but in making them for adoration (now you are leaving out some of God’s word, which follows the part you quote).
In fact, God commands carved images to be made on multiple occasions, for example:
Exo. 25:19 Make one cherub on the one end, and one cherub on the other end; of one piece with the mercy seat shall you make the cherubim on its two ends. 20 The cherubim shall spread out their wings above, overshadowing the mercy seat with their wings, their faces one to another; toward the mercy seat shall the faces of the cherubim be.
Num. 21:8 And the LORD said to Moses, “Make a fiery serpent, and set it on a pole; and every one who is bitten, when he sees it, shall live.”
23 For the inner sanctuary he made a pair of cherubim out of olive wood, each ten cubits high. 24 One wing of the first cherub was five cubits long, and the other wing five cubits—ten cubits from wing tip to wing tip. 25 The second cherub also measured ten cubits, for the two cherubim were identical in size and shape. 26 The height of each cherub was ten cubits. 27 He placed the cherubim inside the innermost room of the temple, with their wings spread out. The wing of one cherub touched one wall, while the wing of the other touched the other wall, and their wings touched each other in the middle of the room. 28 He overlaid the cherubim with gold.
10 cubits, BTW is about 4 metres, or 15 feet.