I do think we have to give immigration a little credit and assume they apply some logic - even if unfortunately that often includes racial stereotyping.
There is no law against being on an extended trip here, if there were they wouldn't renew tourist visas so easily. The country wants wealthy tourists who will spend lots of money, not be a burden on local services, and not try to work. It is a very grey area as to what actually constitutes residence.
A Canadian pensioner whose official residence remains Canada, and who has income in that country, and a genuine family reason for being here on an extended trip - I understand why they took a view that person is unlikely to be either trying to work illegally, and can also support themself and is probably adding to the economy by spending money here.
The other examples of people not being quite so lucky probably have different circumstances. For example, with the 35 yr old - immigration might have wondered how on earth they're supporting themself without working for such a long time? Possibly a high chance of illegal casual labour?
The senior employee who forgot to renew his work visa. Well, he was quite clearly working here illegally, which isn't grey like what constitutes residence, but very black and white.
Yes sadly there is racial stereotyping involved in their decisions. But is it really pure race, or is it just a fact that many south east Asian countries are (on the whole), not wealthy by comparison to western countries? There is a high chance SE Asians could be economic migrants who have specifically come here to work.
Yes it's completely wrong to assess people on anything other than their individual personal circumstances, but we all judge people everyday to a different extent based on what they look like. It is just the same as airport security staff paying more attention to travellers of Middle Eastern appearance, or police stopping and searching more black men in London than white women. They are making assumptions based on statistics.
That's not to say I agree with any of this, I'm just trying to put forward a balanced view of why it might be this way.