I have tested occasionally what will happen to a Photos Library on a network share, on iCloud Drive, etc, just to check on Move your Photos library to save space on your Mac - Apple Support.
I have never seen a Photos Library ending up in the Trash, just by trying to use it on a network storage or in another unsuitable location. All that happened has been, that Photos might crash or hang or lose the connection to the library, or and has been creating new, empty libraries in the Pictures folder, because it had been unable to open the selected Library. Plus the dataloss (missing images, inconsistent metadata) caused by race conditions ans syncing errors, that are to be expected, when accessing a database over a network, that has not been designed as network database. As you are a software engineer yourself, you will know, that network access to a database requires to make the database transaction safe against race conditions. This additional syncing will slow the access down and makes the code more involved. So there is a tradeoff between designing the Photos Library as a full-fledged network database or a slim, fast single-user, local database.
Apple's current design is a compromise - keeping a local version of the Photos Library on locally mounted volumes on each device, and letting them sync with iCloud Photos. This way we can access our Photos Library remotely in iCloud, but not remotely on our local home network.
I cannot reproduce the kind of damage you had to your Photos Library, this is not the normal behaviour - you may want to send a bug report to Apple, for example, using the feedback form for a short report: Feedback - Photos - Apple
Is the system version stated below your original post still valid? MacBook Pro, OS X 10.10 ?