1) There can be instances where your Mac version may not be fully logged in (the Apple ID) but is seeing the "sync" version of messages via the fact the iPhone Number is active.
2) There is another issue that relies on who you were sending to, Apple ID or iPhone Number and which device they may have read that on.
Test for the first 1) potential issue:-
On the Mac version in Preferences > Accounts set it so only the Apple ID is active in the Receive At list (the Start New Conversations drop down will disappear.)
On the iPhone in Settings > Messages > Send and Receive set only the iPhone Number to be active.
On the Mac version start a New Message.
In the "To" spot manually enter your iPhone Number including the Country Code (if you type your name it will not bring up the My Card info)
Send an iMessages (to the iPhone)
If the iPhone does not get the iMessage then the Mac version is not logged in.
Test the reverse
On the iPhone start a new Message and type in your Apple ID and send an iMessage.
Whilst you can set it so the Mac Only send from the iPhone Number (turn ON the iPhone number in Receive At and turn the Apple ID Off) you cannot set the iPhone to use the Apple ID because there is no option to the iPhone Number Off.
However it might provide some info that you did not have before.
If it appears that the Mac is not logged in properly then work though this Users Tip When the iMessages account will not Login
For the second issue you have to know how the iMessages you are replying to was sent To and From.
That is to say that if the iMessages was addressed to your Apple ID then you will reply from that ID even if the "Start Conversation is set to another ID.
Lets say then that the incoming iMessages was sent from a Mac and the Apple ID that is uses, then you send a reply it will be addressed to their Apple ID. That device (their Mac) will be responsible fro sending the "Read" info. If it is Off line then it cannot give info to the iMessages Server that the iMessage was delivered so you get the "Not Delivered" Alert.
Meanwhile their iPhone if set up to Sync (Display on all Devices) may well see the iMessage and as a result you might get a further reply even though you have a Not Delivered alert.
There is no Fix to this "issue" as it is a quirk on the way things work currently.
There are of course instances that might involve both 1) and 2) together just to make life just that little more interesting.
8:20 pm Wednesday; March 14, 2018
iMac 2.5Ghz i5 2011 (Sierra)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
iPhone 6 iOS 11.x and an iPad (2)