I had a similar problem. Unfortunately adding data-bs-pause="false" did not work for me as well as a few other ways that I have tried.
I was following options, methods and events on this page at the bottom: https://getbootstrap.com/docs/5.2/components/carousel/
The only way I have manage to pause it was:
const carousel_elem = document.getElementById("carouselID")
const carousel = new bootstrap.Carousel(carousel_elem, {
interval: 5000,
pause: "hover",
ride: "carousel",
wrap:true,
touch:true,
keyboard:true
})
//make sure these classes are added to your carousel element or else your next and previous buttons will not work.
$("#carouselID").addClass("carousel slide carousel-fade")
//if you want it to cycle
carousel.cycle()
// if needed to pause it when button was pressed add:
carousel.pause(true)
carousel._config.ride=false
carousel._config.wrap=false
//to unpause it:
carousel.pause("hover")
carousel._config.ride="carousel"
carousel._config.wrap=true