Teams returning 502 error on invoke when consenting / declining file upload request

Hi,
I have a bot that was built for Microsoft Teams and it depending on the scenario, the bot may send files across to the user. This bot is used purely for 1-to-1 (i.e. bot and user) interactions only.
A consent card is sent to the user by the bot and when the user clicks on accept or decline, it returns an error. Upon investigating using the developer tools using the browser, it seems to return a 502 error. The full error code is:
Request URL: https://au.ng.msg.teams.microsoft.com/v1/agents/28:xxx/invoke
Request Method: POST
Status Code: 502
Remote Address: xxx
Referrer Policy: strict-origin-when-cross-origin
{"errorCode":1008,"message":"<BotError>Error when processing invoke response: Unexpected character encountered while parsing value: A. Path '', line 0, position 0.","standardizedError":{"errorCode":1008,"errorSubCode":1,"errorDescription":"<BotError>Error when processing invoke response: Unexpected character encountered while parsing value: A. Path '', line 0, position 0."}}
From the message above, I am assuming that it might have something to do with the JSON payload that is sent but as far as I can tell, the payload is properly formatted. Below is an example of the payload that is sent back to my custom endpoint that does this processing:
{
"name": "fileConsent/invoke",
"messageType": "RichText/Media_Card",
"value": {
"action": "accept",
"type": "fileUpload",
"uploadInfo": {
"contentUrl": "https://somedomain.com/some-file-name.pdf",
"fileType": "pdf",
"name": "some-file-name.pdf",
"uniqueId": "c89d7ffb-8099-4638-b4c7-59e8606526d6",
"uploadUrl": "https://somedomain.sharepoint.com/personal/user_domain_com/_api/v2.0/drive/items/012JTFNO74P6O4RGMAHBDLJR2Z5BQGKJWW/uploadSession?guid='1eed3290-65bd-4533-87eb-e75fd058fe16'&overwrite=False&rename=True&dc=0&tempauth=xxxxxxxxxx",
"UrlExpiry": 1678160927000
}
},
"imdisplayname": "John Doe",
"serverMessageId": "1678160628494",
"clientMessageId": "1955409626770268261",
"conversation": {
"id": "19:460ac918-404a-4fc1-b418-dffc75fd8905_af9a22a7-4514-24f7-892b-e125e99c392d@unq.gbl.spaces"
},
"complianceData": {
"action": { "type": "Action.Submit", "title": "Allow" }
}
}
From my custom endpoint itself, it is receiving the payload and it is processing it correctly in an asynchronous manner and so the file does get uploaded successfully even though this error message appears.
[
Can anyone shed any light on why this error message appears? I am returning a 200 OK message back when my endpoint is sent the payload within 2 seconds.
@Shaun Lim- We are not able to repro the issue, as it is working fine from our end.
Microsoft Teams Version 1.6.00.7068 (64-bit)
Could you please try with below sample -
Sample Link- https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-file-upload/csharp

@Shaun Lim-Did you get chance to check?