Can you clarify what you mean by "create a connector action instead"?
In all our cases, the custom code is being used to solve smaller problems. The custom code isn't causing any latency whatsoever. There is unpredictable latency in the backend application, which we would like the end user to be able to handle using native Power Automate timout controls just like they can with any other connector. The 5 second timeout should only apply to the custom code itself.