Why is my function returning a different object type?

Okay I will do.