A 3D texture will suit this use case much better, and it can be set up to automatically handle clamping for you rather than requiring conditions.
You're using GLSL version 440, which means OpenGL 4.4+, so you have support for everything that is required:
The R32F texture internal format.
The texelFetch instruction.
sorry I'm a bit late !
Yes the errors did always happened on the same frames for the exact same model parts across each test iterations, but I've managed to solve the issue.
So basically, I took a glance at the number of position, rotation and scaling keys, and I had noticed that some keys were missing.
For instance, the idle animation must have 48 keys, ...
I think I've found something, the idle animation got some really really slight offsets of movements, I've printed the matrices being used on frame 1 and for all the parts not appearing on screen the matrices got the following pattern:
(0 0 0 a)
(0 0 0 b)
(0 0 0 c)
(0 0 0 1)
Those are glm matrices (column major).
Maybe due to the really slight difference ...
The code corresponds to the very good Water Tutorials from ThinMatrix. I also had the same problem with the camera today. I forgot that changing the Pitch requires an update of the camera vectors - especially the Front-Vector. In the InvertPitch() function, the Update function of the camera class must be called: