I tried two different apps (not the Music app) with and without passcode, and the music continued playing in spite of the autolock settings. So maybe it's the app you're using (mine were Dropbox and Amazon Music), or there's a glitch somewhere. Try the usual troubleshooting fixes when something is not behaving as expected: restarting, resetting, force closing apps. Restart: turn off your iPad, turn it on again. Reset (won't remove settings or data onyour device): press and hold Home and Power button simultaneously until the Apple logo appears, release both and let the iPad power up on it's own. Force close apps: either double tap Home button or perform a four/five finger swipe upwards to reveal the multitask bar (you'll see the app icons below the thumbnails of the apps). Swipe the thumbnails towards the top of the screen to remove apps from there.