you need to add
camera.rotation.order = 'YXZ' // default 'XYZ'
in your init()
function
reason: rotation matrix multiplication order
you can see detalised info here: https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
also if you add this:
const axesHelper = new THREE.AxesHelper( 15 )
//axesHelper.renderOrder = 1;
axesHelper.material.depthTest = false;
scene.add( axesHelper )
in init()
it will show world axes (and will be always on top of all objects) i needed that while cheking your code so maybe you also will need it in future