Feeling like a failure

Ever since I brought my little one home I've been trying to correct her latch. It's very shallow, all she is doing is nipple feeding. Milk transfer is very slow so it takes a long time for her to be satisfied and hurts my nipples like crazy. Tonight for the first time I gave in and had to top her up with formula after feeding her for almost two hours or more. Now I can't stop crying because I feel like a failure. I know it's not going to hurt her I just feel guilty that I gave in. It's important for me to breastfeed her and I don't want to give up but it hurts so bad. I'm seeing a lactation consultant tomorrow so I am hoping she has some good tips for me. Sorry for the rant 😔