Hi,
Problem is that you can't get custom field value from tree node object unless you specify types (class name). It's working well when you use HomeProvider because it's strongly typed. To make your code works with tree provider, you must specify types of the nodes that you wanna get, something like this:
var homeNode = treeProvider.SelectNodes().Path("/home").OnCurrentSite().Type("custom.HomePage").Culture(lang).TopN(1).FirstOrDefault();
If you want to get custom fields of several page types, you can specify all them by using Types() extensions like this:
treeProvider.SelectNodes().Path("/home").Types("custom.HomePage", "custom.AboutUs")
Best regards,
Dragoljub