Upvote:2
I am not aware of Catholic teaching on the subject. However "love your neighbour as yourself is a quote from leviticus 19:8.
Rabbai Hillel is often cited as the first person who uses it as a summary of the law. You can read about that here
https://www.thetorah.com/article/love-your-neighbor-how-it-became-the-golden-rule
When Jesus also includes the commandment to love God (death 6:4-7) he goes beyond what hillel had said. This makes sense because this commandment cannot be derived from the other.
These fit neatly with the ten commandments. Commandments 1-5 each include God's name and focus on how you should relate to him; whereas 6-10 focus on your relationship with people.