Fairly minimal working example (varioref is not necessary, but its output really twists the knife IMHO):
\documentclass{article}
\usepackage[letterpaper, margin=1in]{geometry}
\usepackage{needspace,mwe,varioref}
\renewcommand{\topfraction}{0.99}
\begin{document}
% This is just here to take up space, could be text instead
\includegraphics[height=5in]{example-image-a}
\needspace{10\baselineskip}
\vref{fig:foo}
\begin{figure}[t]
\centering
\includegraphics[height=3in, width=\textwidth]{example-image-b}
\caption{foo}
\label{fig:foo}
\end{figure}
\begin{itemize}
\item foo
\item bar
\item baz
\item blee
\end{itemize}
\end{document}
This puts the float with example-image-b at the top of page 1, then example-image-a, then there is a page break and the \vref appears on the next page as "1 on the preceding page."
Why is my float appearing at the top of page 1 when the surrounding text is on page 2, the previous page? And, perhaps more importantly, how should I fix this?
I am guessing that it's something to do with \needspace. All TeX.SE hits for float placement either don't address the float appearing on a previous page, or else say that this is not possible! For example, the excellent answer in How to influence the position of float environments like figure and table in LaTeX? says that a float, "[can] not end up on an earlier page as the surrounding text due to the fact that LaTeX does no backtracking an the earlier pages have already been typeset." (Though perhaps I'm not reading this correctly.)
This MWE is, of course, somewhat contrived. In my real document \topfraction is less than 0.99, and I'm using the default float placement (tbp in article IIRC), but I am nonetheless having a float appear at the top of a previous page after using \needspace on the paragraph preceding the definition of the float. My actual document uses \needspace to keep a short introductory paragraph together with the list it introduces.
EDIT: David Carlisle suggested replacing \needspace with \Needspace, which does put the text on the right page, but which then fails to keep my paragraph and my list on the same page, which was the original intent. MWE updated with increased height to example-image-a. Now, using \needspace still behaves as before, with the \vref being pushed to the page after the page where the float is placed at the top, but if you replace \needspace with \Needspace it now puts the \vref paragraph at the end of the first page, and its accompanying list on the second page, which is undesirable [in my real document where I want the short paragraph to introduce the list].
needspace. Other TeX.se answers tell me that "something other" is rewriting my document, or use ofsamepage, or\@beginparpenalty=10000before this list, I think. I'll accept Mr. Carlisle's answer since he at least explained what was going on. – dsedivec Oct 07 '17 at 17:50