Does the poem "To a Mouse" by Robert Burns offer a more optimistic view of failure than the novel?
I would say yes. In "To a Mouse," burns apologizes to a mouse after ruining his home with a plow. He feels truly sorry that he has caused the destruction of her home, especially since winter is coming and the mouse worked so hard to prepare for it.
What makes this a more optimistic than Of Mice and Men is that the author tries to comfort the mouse. He may not offer any kind of advice for what she should do about her home, but he does try to comfort her by saying
But Mouse, you are not alone,
In proving foresight may be vain:
The best laid schemes of mice and men
Go often askew,
And leaves us nothing but grief and pain
In this stanza, from the Standard English translation, Burns is telling the mouse that she is not the only one who has planned so well yet failed because of outside factors beyond our control. While this does seem deppressing, there is something reassuring in knowing that we are not alone in something, and this is what the poem is saying.
He adds a final positive note, for the mouse at least, by saying that she is better off still than he, because he has to look back on past failures, while she can forget what has happened and move on.
While Of Mice and Men says many of the same things, i.e. that we cannot make plans because they will likely fail due to things we cannot control, it doesn't have the reassuring tone from the author. Steinbeck clearly wants readers to see that our dreams cannot be reality, and he doesn't give us anything close to a hopeful note and the end.