This also happens in Scene Kit, with very simple projects, just particles, nothing else.
The Renderer component of the onscreen stats seem to add time to the frame activity to force it to lock at 40fps. So if other activities take less time in a frame, it bumps up the time in Renderer to maintain a stable 40fps.
I think this is a throttling similar to what happens with KernelTask on Macs when they get hot.
I'm not sure what the reason for it is. Turning on Quicktime on the Mac, and setting to do a screen record can jolt the device out of this state, or push it into it if it's not otherwise doing it.
This happens using both OpenGL and Metal on the device, which makes me think this is an OS function, pre-emptively featured as a result of impending 120Hz screen availability wherein 40fps is a reasonable compromise if an app can't maintain a stable 60fps.
Perhaps the new Apple TV will support 120Hz screens, or the iPad Pro has a 120Hz refresh within its variable frame rate technology.