The bug not related to the core library. This custom style:
#beforeafter {
width: 800px;
max-width: 100%;
margin: 0 auto;
}
800px
fixed width create horizontal scroll on mobile.
Not related specifically to before/after plugin - even for empty div => not responsive.
Use the core library CSS
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mhayes-twentytwenty/1.0.0/css/twentytwenty.min.css" />