You didn't do anything wrong my friend. The Loperamide just did what it's capable of doing which is lessening/eliminating opiate withdrawal symptoms for a period of time.
That being said, ***PLEASE BE CAREFUL WITH THE LOPERAMIDE!*** It can definitely turn into an addiction before you even realize it. Last winter, I started taking it during the early stages of Suboxone withdrawal to help with my symptoms...welp, before I knew it, I was taking it every day and also increasing my doses at that. I never got too crazy with my use of it (topped out at about 40mg per day) but doing that for six months straight got me very addicted to the Loperamide. I'm currently right in the thick of cold turkey Loperamide withdrawal and it is absolutely no joke. It takes a very long time to get through and the symptoms can be absolutely agonizing.
Use the Loperamide sparingly to help cope with your symptoms and taper off it as quickly as you can tolerate. Good luck!