The elements of $\mathscr{O}_{\mathbb{A}^n,a}$ are just rational functions $\frac{g}{f}$, where $f, g$ are polynomials of $n$ variables (i.e. elements of $\mathscr{O}_{\mathbb{A}^n}$) such that $f(a) \neq 0$.
This of course is nothing but a copy of Lemma 3.21 in your linked notes.
Intuitively, you should think about $\mathbb{A}^n$ as the $n$-dimensional complex space $\mathbb{C}^n$.
A polynomial $f\in \mathbb{C}[X_1, \cdots, X_n]$ then defines a function on $\mathbb{C}^n$: it sends a point $a = (a_1, \cdots, a_n)$ to $f(a_1, \cdots, a_n)$.
Now if $f, g\in \mathbb{C}[X_1, \cdots, X_n]$ are two polynomials, in general you cannot say that $\frac{g}{f}$ defines a function on $\mathbb{C}^n$, simply because the value of $f$ may vanish at some points.
But for a given point $a$, if we have $f(a) \neq 0$, then it's clear that $f$ does not vanish in a small neighborhood of $a$ (with respect to the usual topology of $\mathbb{C}^n$), hence on that small neighborhood we may define $\frac{g}{f}$ without problem.
And if we gather all functions that can be defined as $\frac{g}{f}$ in a small neighborhood of the given point $a$, we get the local ring $\mathscr{O}_{\mathbb{A}^n,a}$.
Let $i : X \to \Bbb P^r$ an embedding, then we can define $\mathcal O_X(n) = i^* \mathcal O(n)$. As you said, section of $\mathcal O_X(n)$ are quotients of homogeneous polynomials of appropriate degree, restricted to $X$.
In particular, any $f/g$ (as a function on $\Bbb P^r$) has poles on an hypersurface $Y \subset \Bbb P^r$.
If $X$ has positive dimension, then $Y \cap X \neq \emptyset$ and hence $f/g$ also has poles on $X$. It follows that $\mathcal O_X(n)$ has no global sections when $n < 0$, assuming $\dim X > 0$.
Best Answer
I found the example here: Ex 1.11 in https://www.mathematik.uni-kl.de/~gathmann/class/alggeom-2021/alggeom-2021-c1.pdf . Clearly Gathmann is assuming the ideal is proper.