It's expected behavior. When you have a singleton class singleton_class.ancestors is:
[singleton_class, attached_object_class, ...]
In this case the lookup for starts at A, which is attached_object_class.
It goes to the right so it never searches singleton_class. The lookup resolves when the
constant is on attached_object_class and it starts at singleton_class:
Constant lookup behaves lexically, here the scopes around method c are A and top-level/Object.
So here it looks in A, then Object, then ancestors of A. It never looks in subclasses of A (and klass is a subclass of A).