Advising writers can come from many places – both physical and psychological. There is advice clearly designed to get rid of any potential competition by assuring people about the negatives: much like with acting and some of the other arts. “That’s great; so what are you going to do for a living?”
There is some truth to that advice: the vast majority of those who try to earn a good living in the field fail to, but there are many roads to real success within the industry which may be viewed as special information.
Salaried journalists and people with relatively day jobs working in the publishing industry as editorial assistants and literary agents may or may not choose to say to someone something like “Don’t quite your day job” or “There’s no money in writing,” but when people hear them say that, if they even do, it seems harder to quite believe.
When one meets struggling poor people who seem bright and talented but not earning much and they admit to being writers or claim to be, then it seems believable. This is more like the stereotypical wait staff in restaurants explaining that they are an actor or actress. It is not necessarily a lie, but evidently it is not going that well or else it is just not how it seems.
When it is a novelist or an actress – well, it is one of those professions where a lot of people scoff until or unless one makes it big, if that ever happens, and then they just smile and tell you how they were behind you and believed in you all that time and you let their lie go because you want them to still talk to you because aside from that, they were often kind to you. Many never make it that big, and some make it to something in between total failure and overwhelmingly successful.
Teachers, when they care, will not usually discourage their students but may encourage the art without being able to help make any connections to paying work. There are acting coaches and MFA literature teachers who can give students the keys to financially inclusive real world professional success but many cannot.