iPhone "un-downloading" photos in Messages
When you have iMessage iCloud Syncing enabled (this switch is located in iCloud settings, as opposed to iMessage settings, your device will remove downloads since they're stored in your iCloud account. This is done to keep your local storage space available.
If you turn off this feature, your phone will probably download your messages. However, if you don't have enough space I do not know what solution it will propose.
In theory, if you have sufficient space, iMessage iCloud Syncing will not remove your local file downloads.