A message can be received and still show no delivery confirmation. That is not a bug in your gateway, it is how carrier receipts work, and it changes how you should read your numbers.
A self-hosted SMS gateway is one binary with an embedded database. It fits on a free cloud instance, on a server you already run, or on a box in the office.
A price per message looks small until you multiply it by three years of traffic. Here is how to count what you actually pay, and what you stop paying when the gateway is yours.