What makes this kind of task so difficult to accomplish in R?
This is fundamentally the wrong meta question. There is not a lower bound on question difficulty here. There is, instead, a lower bound on detail, explicitness and clarity, and an upper bound on the number of questions in a question post (one, but with some wiggle room for things that really can't meaningfully be considered independently).
There was a question asked recently about obtaining pairwise squared differences from numbers in a data set in R. What got my attention about this question was that although the task to be performed and the desired output were clearly stated (with both a written description and properly formatted code), the asker hadn't included any specific attempts at actually solving the problem.
While I know that not every question requires a long list of failed attempts [!], the ones that don't usually tend to be more on the conceptual side, or else asking about a specific API which is lacking in documentation. (Or else, they usually at least explain why the specific task is difficult to accomplish.) But, this question didn't seem to fall into any of those categories.
No question requires a long list of failed attempts. In fact, most "failed attempts" are noise that should be edited out, except insofar as they actually clarify the question.
It's important to understand that researching a question is absolutely not about "deserving" an answer. It is about making sure that the resulting question meets standards. Absolutely nothing to do with this process is about the person who asked; it is only about the question itself.
Nearly all questions fall into two fundamental categories: "What is wrong with the code I tried?" and "How do I perform this task?" Only the former category requires even one failed attempt - because the question is about the failed attempt. But the latter are fully complete, useful and up-to-standard as long as they:
Are clearly stated, on-topic and not a duplicate (as usual)
Are demonstrably about one task, that does not have an obvious decomposition into separate steps that could be asked about (unless OP has already solved it that way and is looking for a more "direct" or "built-in" way, and has reasonable ground to expect that one exists)
Give a clear specification of the task, including a precise input (in a reasonable format, such that "make sense of the input" isn't a separate step) and corresponding output. (For a computational task like this one, that just means getting a sensible data structure within the program's memory; if OP is looking to format displayed output in a specific way, that is generally a separate step, but that part can usually just be edited to make the focus problem go away.)
OP here is asking to compute pairwise squared differences from some iterable. The question has some irrelevant detail, in that the problem is specifically about applying the computation to prices that come from a larger data set - the rest of the data is irrelevant. Someone with subject matter expertise in R should be able to edit the example to be properly minimal, but that's detailed polishing that's well above the minimum standard for questions.
OP already knows how to compute the squared difference between two values (unsurprisingly), so the question is really about one specific thing: how to consider the values pairwise and apply that calculation logic to each pair. I imagine that it should be fairly easy in R to write an explicit loop and do this imperatively, but this is also the exact sort of task where people who use languages like R (or Python, for example) reasonably expect a higher-level solution built in.
It's also noteworthy that "pairwise" has two meaningful interpretations: considering adjacent pairs (first and second values, third and fourth, fifth and sixth, etc.) or overlapping pairs (first and second, second and third, third and fourth, etc.). In this case, OP clearly means the former, and has clearly expressed that by showing both a calculation and an expected output that corresponds to the sample input. Bravo.
So in my mind, the only remaining question is where this is really a duplicate of some more abstractly asked R question about applying a calculation to adjacent pairs. I don't know much more about R than the fact that it exists, but for Python I could easily dupe-hammer these kinds of questions - so I'll explain how I do it, in case an R expert is lurking and knows of analogous Q&A.
In particular: for Python, I would be able to point at How to iterate over a list in chunks for the adjacent-pair problem. Conceptually, the problem boils down to obtaining the adjacent pairs, so that the calculation can be applied. In Python, once you have an iterator that gives you adjacent pairs, applying the calculation is trivial and there are a couple of standard ways to do it. That also gets asked about a lot (or rather, beginners have debugging questions related to horribly wrong attempts), and I didn't like any of the canonicals for the "apply the calculation" part in the long run because none of them really had the right focus - so I wrote my own.
Meanwhile, for the overlapping pair problem, that is covered by How can I iterate over overlapping (current, next) pairs of values from a list?, or more generally Rolling or sliding window iterator? (considering more than two elements at a time; the case of a small, specific number of elements allows for additional approaches that might be considered simpler or more elegant). Again, applying the calculation to the resulting pairs can be considered a separate problem in Python. But for all I know, they could be fundamentally inseparable in R. If they are separable, it comes across to me like the question could be focused on the iteration part, since again OP already knows how to do the per-element calculation. (Looking at the R answers already given, I get the general impression that the collection step can't really be separated out as easily as it would be in Python.)