When you look at the bootstrap documentation for the version you want to use, you will find that the markup of the modal has slightly changed. (https://getbootstrap.com/docs/5.1/components/modal/) The data attributes have now an added -bs-
in them.