I had the same problem and found the following solution:
Item[] items = Sitecore.Context.Database.SelectItems(query);
This won't work since your code is executed in the (current) context. And code is executed in the path
/sitecore/content/ShrinersHospital2/CareAndTreatment
With your query above you tell sitecore to search from the path
/sitecore/content/ShrinersHospital2/CareAndTreatment/sitecore/content/ShrinersHospital2/CareAndTreatment
which will return 0 items as result, because the path does not exist.
Try the following query:
string query = "//*[@@templatename = 'CareAndTreatmentType' and @TreatmentType = '{ECDBE944-99DE-4347-8FA2-6613FA85402C}']";
Item[] items = Sitecore.Context.Database.SelectItems(query);
When you switch your database to "web", you do not have a context and your "starting" path is /. Then the code below returns items with your query, because the path exists
/sitecore/content/ShrinersHospital2/CareAndTreatment
string query = "/sitecore/content/ShrinersHospital2/CareAndTreatment//*[@@templatename = 'CareAndTreatmentType' and @TreatmentType = '{ECDBE944-99DE-4347-8FA2-6613FA85402C}']";
var database = Sitecore.Configuration.Factory.GetDatabase("web");
items = database.SelectItems(query);