Calibrating left & right cameras issues

This is the code I use for calibrating my cameras. After collecting 30 images (on left and right cameras), I run this script to see my error on left and right cameras. It used to be around the 0.20 mark for both, however I suspected that this was due to my dataset not being diverse enough (chessboard did not have a variety of positions). I tried tilting the chessboard, raising it, rotating it, etc. After doing a dataset like this, my error is now 1.12 for left and 0.56 for right. I’m assuming the issue may be with my script, so I was wondering if anyone could help/point out anything wrong with the calibration part. Thanks

I keep getting a 403 error when trying to post my code. Does anyone know how to solve this?