The number of RPC will return depends on the amount of time it takes to build the result set. You can get the remainder of the table by starting with an offset returned by the "more" parameter in the first query.
However, the table may change between your two queries, giving you inconsistent results.
If your table changes rapidly, you might want to ...
Error-Code 3040006's message is "Transaction Expiration Too Far"
What kind of client (cleos, eos-js, eos-sharp?) and what kind of network (EOS-mainnet, Telos, Wax?) are you using?
Default maximum transaction lifetime is 3600 seconds, therefore if expiration exceeds this maximum, you will get this error.
Here are the things I would do:
Check if ...
I think the API you are looking for is http://localhost:8080/v1/chain/push_transaction
Behind the scene cleos push action contract_name action_name'[param1,param2]' -p count@active construct a transaction and signs it with your private key. After that, the ready transaction becomes broadcasted to the chain