Hello. First of all, thank you for your nice code.
I wonder how you did the shift method for the bias during quantization.
Looking at your code, you filled the bias shift part with '0'. According to the ARM CMSIS Deploy Guide, bias left shift does the following. https://developer.arm.com/documentation/102591/2208/Compute-the-layer-shifts
Have you ever used a method other than that?