@Shashank A Mishra Thanks for reaching out. This is the limitation of inline code that needs to be executed within 5 seconds or fewer. In case if your inline code logic takes more than 5 second then you need to offload the execution of the code to azure function.
The same is documented here.
Let me know if you have any further queries or concerns.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.