Can't return TQueue from a function

upd. I’m not sure what happened exactly (if you know, please reply), but changing TQueue to its pointer seems to resolve the issue