You might take some comfort that the ending works a little differently in the screenplay version PKD wrote later so that it makes more conventional 'sense'. Even the author had second thoughts about it. Whether it's really better that way is a debatable point.