Function returns 502 Gateway Error

It says timeout. Check: [Support Guide] Why is my function taking long or timing out?