Could you please let us know the Pega Platform version that you are using in your application?
Also, provide us the details about the storage location for case and pulse attachments. You could find the same in the Application definition under "Integration & Security " tab. Is that pointing to Store in Pega database ? or any repositories?
I am able to reproduce the reported behavior in-house with content storage set to "Store in repository". However, I am unable to recreate the same when the content storage set to "Store in Pega database".
i.e., the error occurs only when the files with the same file name is added to the attachments of the case if the content storage set to "Store in repository". It seems to be expected behavior as the repository/folder doesn't allow to have duplicates (Multiple files with the same file name) in it.
I suspect the error getting disappeared on the screen might be because of the harness/section refresh. However, the same error can be found in the clipboard. If you want the error message to be displayed even after second click, you could perform customization based on your business requirement.