Gently and kindly, please don't give up the swimming, but possibly look at a different school.
I nearly drowned at 5, luckily my dad got me back in the pool and I'm super confident in the water but have no technique at all. I'm a recipe for drowning and keep meaning to go back for classes.
Meanwhile swimming has always been my non negotiable with my daughters until senior school. I did baby classes with them and didn't stop. They did a year of swimming competitively too and quit in years 7 and 8. We just got sick of the mornings.
My girls were like yours at five. Please persevere.
Swimming opens so many doors and gives them so many options with sports later in life, plus it is so hard as an adult to learn to swim and dive properly, so just give her one less obstacle for later, a bit like teaching teenagers how to work a washing machine and clean a house.
I would not give up the swimming lessons but I would consider whether your child should be at a different swimming school. Look for one that feeds into competitive swimming clubs (because you know that they will teach the right strokes).
We had one rubbish one (they missed my youngest drowning), then a good one but the owner sold it to someone who was rubbish, then one brilliant one and then the competitive club. If you can make it work and have time, I would try and fit in an intensive course in a holiday somewhere. Sometimes a solid week of technical really drives the skills home.
Neither of my girls were the best swimmers and had no olympic dreams but those extra years made them super strong and their technique is brilliant. Also learning how to properly train in lanes and do the turns is not for the amateurs to teach!
My daughters have that skill for life now and it never goes. My ex husband swan competitively, even in his 40s and travelling with work, he'll find a pool and my female friends who swam do the same. I really envy them both and wanted that for my daughters.
Saying all that. Dragging them both to a pool every week for years was horrendous.so I do understand why you feel the way you do, but please do try and push through.