Wicked has a few leaps from it’s origin as wisdom. Think what the general middle ages view of witchcraft was and use that as a guide.
The very basic is that the word became associated with “wise folk” later with hedge wizards and then all sorts of practitioners of devilry. There is more to unpack, but that’s the rough up.
Cunning has a slightly less clear origin but the best we have so far is as you describe…
However, keep in mind how English came about. The native Briton people have exceedingly little input towards the language spoken in the lands their ancestors dwelt in. The Sassanach invaders were quite thorough, hence English sounds nothing like Cymric (Welsh). Angles, Saxons, and others incoming spoke something much more closely related to Deutsch (German) and scrummed significantly with the “Danes” (Nordic people that were not primarily from Denmark, but that is a very long tangent. Basically remember that the English continued to call the native people of the 'Murikas “Indians” long after they realized they were nowhere near India. This sort of trend extends centuries into the past). Thus words of Nordic origin are not seen in a positive light. But wait, Deutsch also using a similar word, Kennen for Knowledge and Understanding!
Let us continue, the Normans, Francophone and Francophied “Danes”, would later roll up and roll the Saxons right off the top of the pile. The language of the high courts became French, language of the low became Germanic. This arrangement was not to last, but during the fusing process of the language, many concepts came to have two or more words, and the word with the villain (lower class) origin (read: Celtic, Gaelic, Dane, or Germanic) was sorted as the base, vulgar, or less upstanding and noble of the meanings while the Latin (read: French/Norman/Ecclesiastic) would be the more virtuous or refined. For example, a swine (schwein) is living pig, but pork (porc, porcus) is the edible meat. Deer (dier, tier) is an animal but Venison (venesoun, venatio) is it’s meat (in this case literally, as Tier just means animal, and Venatio is to hunt and in times that will seem long ago to those who grew up with radio, Venison was any terrestrial meat hunted rather than domesticated). Thus Cunning, of colourful origin, but definitely not French/Latin, became the intellect of the base, the morally/socially low, or the beastly in Middle English (read: post Normans) on.
In many ways English is one of my favourite languages for demonstrating the fruits of plural cycles of conquest and subjugation before (if the vanquished are lucky) integration. The vocabulary and grammar alone tell a story of turmoil, triumph, and repeated turn over in dominance.
But this one digresses.
Also, this one loves the term Cunning and takes it as high praise. The “wisdom” of humanity has been turned to cruelty and atrocities that stagger the mind and breeds in us self destruction in almost equal measure to success. The cunning of beasts is a tool for pure survival.
Perhaps that is why this one enjoys Howard’s works so much.