I am trying to implement a character controller using Bullet for collision detection. I use a kinematic ghost object, and my approach in general is very much similar to the approach used in btKinematicCharacterController, however with some additional features.
In my test program the static world is a single triangle mesh. I use a capsule collision shape for the character. In order to perform a step, every frame I do a convex sweep test, raising the capsule stepHeight higher than its original position and sweeping to the target position (the target position determined from user input is also raised accordingly). If it hits something, I stop a small distance before that collision takes place, otherwise, I do the full step. Then, I do another sweep downwards to find where the ground is. There is also some logic to slide along surfaces, but I don't think it is relevant to the problem that I have.
When I hit a surface during the ground test phase, I would like to see what is the slope of the surface at the point of collision, and if the slope is too steep, the character should slide down. I assumed that m_hitNormalWorld in the sweep test callback was what I needed (i.e. the normal of the colliding surface), but apparently it is not, or not always. Everything worked fine until I tried to test a stairway. The character started to exhibit some weird behaviour around the step edges. It was occasionally sliding back down, despite the fact that the sides of the steps were vertical and it should have been "stepping over" them (I realise that there is rarely such thing as an absolutely vertical triangle in floating point computations, so I added a threshold to the step size so that it doesn't get too small even if the FPS is very high, that didn't help).
After some debugging, I realised that the normals that were coming from the convex sweep test were not actually normals of the surface that the character ended up standing on. They look like this:

I wonder what is the physical meaning of those normals? In the case of a capsule collision shape (that is round), I suppose they can be visualised this way:

But then I tried to replace the capsule with a box, and this is what I've got:

The strange normals are still there, but now they don't make any sense to me, since they are not perpendicular neither to the triangles of the mesh, nor to the sides of the collision box. Trying to visualise where these could come from, I came up with something like this:

So I have these questions:
1) What is the actual meaning of the m_hitNormalWorld in the convex sweep test callback object? Why is there such a case where this normal is not actually a normal of any of the involved surfaces?
2) Is there a way to reliably determine the normal of the surface that the convex sweep test ran into? Or maybe determine the particular triangle in case it is a mesh?
Thank you very much in advance,
Ivan.