Storage space and system functions error message I keep getting an error message on my Samsung Galaxy S5 as follows:

Storage space running out.  Some system functions may not work.

In reality I have nearly 400 Mb available.
I assume you mean MB, not Mb (MegaBytes versus Megabits). 400MB is considered VERY low on storage space for a mobile device. It gives you very little room for apps to decompress before being installed, nowhere near enough room for system updates, and because of how flash memory works, that little space available will dramatically slow down your phone.

I'm not sure what capacity phone you have, but regardless, 400MB free is considered danger zone on an Android device. Try to have at least a gig free.