Fix code scanning alert - Returning tuples with varying lengths
<!-- Warning: The suggested title contains the alert rule name. This can expose security information. -->

Tracking issue for:
- [ ] https://github.com/NVIDIA/NeMo/security/code-scanning/1901
