Hi, I want to find an example of a MorseBott function such that for at least one of the critical submanifolds, the orientation sheaf O is nontrivial.

You can find such a function on the Klein bottle. If you think of the Klein bottle as $S^1\times [0,1]$ with the two boundary components glued together via a reflection $\phi$, and if $f:S^1\to {\mathbb R}$ is a Morse function with two critical points which is invariant under $\phi$, then $f$ extends to a MorseBott function on the Klein bottle such that the circle of maxima has a nontrivial orientation sheaf. 


You can get a large class of examples if you look at the real projective space $\mathbb{RP}^n$. Each point $L\in \mathbb{RP}^n$ is a one dimensional subspace in $\mathbb{R}^{n+1}$ and we denote by $P_L$ the orthogonal projection onto $L$. Fix a unit vector $v\in \mathbb{R}^{n+1}$ and denote by $U$ the orthogonal complement in $\mathbb{R}^{n+1}$ of the line $L_v$ spanned by $v$. Consider the function $$f_v: \mathbb{RP}^n\to\mathbb{R}, \;\; f_v(L)=(P_Lv,v). $$ Note that $$ 0 \leq f_v(L)\leq 1,\;\;\forall L.$$ This is a MorseBott function with precisely two critical submanifolds: the locus of minima where $f=0$ and consisting of the real projective space $\mathbb{P}(U)\subset \mathbb{RP}^n $ of lines in $U$, and a unique maximum point, $L_v\in\mathbb{RP}^n$ where $f_v(L_v)=1$. The normal bundle of $\mathbb{P}(U)\subset \mathbb{RP}^n $ is the tautological real line bundle over $\mathbb{P}(U)$ which is nonorientable. 

