For the sacrament of confirmation to be conferred validly, the recipient must at least have the intention of receiving it. It would seem that at the time you did not have the necessary intention of receiving the sacrament, so you did not validly receive it. But don’t worry. While confirmation cannot be repeated, it may be conferred conditionally in a case such as yours. I recommend that you contact your pastor about this.