The treasures of India’s wealth of wisdom lies in its billions of texts of yore. There is a detailed wisdom for everything really but each is categorical as when that category or boundary that defines something is destroyed, the wisdom no longer works, the path no longer is.
The Upanishads were written for the jnanis, yogis, and pious brahmanas and not for kings. Thus those slokas are apt for them in the Upanishads for the world view. ie. for those who are selfless and seekers of Self.
The Hitopadesa and Panchatantra as well as Chanakya’s works are all for the Kings / Kshatriyas / politicians (the western world of materialism). Thus they speak about politics and guarding and about treachery of an opponent king who might quote oneness and then stab from the back.
Thus both are relevant rightly to the context.
When it comes to the business class (vysyas), it is about charity and philanthropy.
When it comes to the service class (sudras), it is above love and respect for everything in this Earth.
Therefore there is absolutely no contradiction anywhere and all falls into place when the caste system was not tainted and when the Western world did not think that everything is everything without boundaries and borders.