bitcoind – Unstable bitcoin node behaviour

I have a bitcoin node with the following configuration:

server=1
txindex=1
rpcuser=user
rpcpassword=pasword
maxconnections=20
maxuploadtarget=7168
proxy=127.0.0.1:9050
bind=127.0.0.1
rpcbind=onion_domain.onion
externalip=onion_domain.onion

The bitcoin node is up, fully sync and I can access it through the browser. Until that point I do not face any issue.

The issue is that I want to access the bitcoin node from command line using curl and from a small php script. Both methods generally work but sometimes I get "Empty reply from server" I am really frustrated because I was checking bitcoin node’s logs but I do not see any problem.

And also in the same computer maybe I can execute the curl command line without any problem but not the php script or vice versa.

I lowered bandwidth and connection in case the network could be collapsing but the issue is still there.

Anyone know if I am missing something? Thanks