Getting different result from length contraction and Lorentz transformation Consider two persons $A$ and $B$ and $B$ is moving with velocity $+0.6c$ in $+x$ direction.
Take the frame $S$ in which A is at rest but $B$ appears to move in the $+x$ direction with velocity $0.6c$. $S'$ is the frame in which $B$ always is at rest and is at origin.
So, $\gamma=\frac{1}{\sqrt{1-\frac{v^2}{c^2}}}=\frac{1}{\sqrt{1-0.36}}=\frac{1}{0.8}=1.25$
Event-1 Origin of $S$ and $S'$ are coinciding at $t=t'=0$.
So, $$x_1=0,t_1=0$$
$$x_1'=0,t_1'=0$$
Event-2 $B$ reaches at point $P$ which is at $x=3\;light\;years$
$$x_2=3ly,t_2=\frac{3ly}{0.6c}=5\;years$$
In $S'$ frame, $B$ always is at rest and see the point $P$ to coming towards it by velocity $0.6c$
$$x_2'=0,t_2'=?$$
By Lorentz transformation,
$t_2'=\gamma\Big(t_2-\frac{vx_2}{c^2}\Big)$
$t_2'=1.25(5yr-(0.6\times3)yr)$
$\implies t_2'=1.25(3.2)=4yr$
So, in $S'$ frame after $4yr$, P reaches the origin of $S'$.
Now we can get the same result using Lorentz contraction,
$Length\;OP$ in $S'$ frame=$\frac{Length\;OP\;in\;S\;frame}{\gamma}=\frac{3ly}{1.25}=2.4ly$
So, Time taken by far end to reach the origin in $S'$=$\frac{2.4ly}{0.6c}=4yr$
Event-3
Now suppose if I am interested in finding out the position of origin of $S$ in $S'$ when $B$ reaches $P$
$$x_3=0,t_3=5yr$$
$$x_3'=?$$
$x_3'=\gamma(x-vt)=1.25(-0.6c\times5yr)=-3.75ly$
But $Length\;OP$ in $S'$ frame=$2.4ly$. This means when the far end reaches $x'=0$ this means the other end reaches $x'=-2.4ly$.
The question is using Lorentz transformation, $x_3'=-3.75ly$. But by considering $OP$ as a rod and using Lorentz contraction, I get $x_3'=-2.4ly$.
Why this is so? And which one is correct? I am very confused.
Addendum
Basically the question is how the two events "position of $O$ in $S'$ frame when $P$ is at the origin of $S'$" and "position of $O$ in $S'$ frame when an event occurs at the origin of $S$ at $t=5ly$" are different?
 A: Additional comment regarding the use of the Lorentz transformation for this problem.
SEE BELOW.

UPDATE:
(A note on notation, you use capital letters to refer to points in "space",
which trace out worldlines. In my original answer, I referred to "P" as an event (akin to a point in the diagram). In your notation, I should have referred to it as "event-2", when worldline-P meets worldline-B.)
A spacetime diagram will help interpret your numbers.

Drawing it on rotated graph paper will help me draw in the ticks ("light clock diamonds") as traced out by light-rays in various light-clocks.
In your "Event-3" section,

*

*Your first attempt uses the event (that I call) ev5
which has coordinates $(t_5, x_5)=(5,0)$ and $(t'_5, x'_5)=(6.25, -3.75)$.

Although the (Alice) S-frame regards ev5 to be simultaneous with ev2,
the (Bob) S'-frame does NOT regard them as simultaneous.
That is, the (Bob) S'-frame does NOT regard the spacetime-segment ev2-ev5 as purely-spatial.

Instead,
it is the spacetime-segment ev4-ev5 that is purely spatial according to the (Bob) S'-frame.
That displacement is $-3.75$, as you computed.


Your method using the Lorentz transformation is correct... but you used the wrong event.
ADDITIONAL COMMENT:
Use the other part of the Lorentz transformation:
$$t_3'=\gamma(t_3-vx_3)$$
With the ev5 , one gets $t_3'
=\frac{5}{4}(5-\frac{3}{5}0)=6.25$.
According to the (Bob) S'-frame,
this is NOT simultaneous with ev2 $(t'_2,x'_2)=(4,0)$.

With the ev3 [below] , one gets $t_3'
=\frac{5}{4}(3.2-\frac{3}{5}0)=4$.

According to the (Bob) S'-frame,
this IS simultaneous with ev2 $(t'_2,x'_2)=(4,0)$.



*Your second attempt (via the length contraction formula) implicitly uses the [correct] event  ev3
which has coordinates $(t_3, x_3)=(3.2,0)$ and $(t'_3, x'_3)=(4, -2.4)$.

The (Bob) S'-frame DOES regard ev3 to be simultaneous with ev2.
That is, the (Bob) S'-frame DOES regard the spacetime-segment ev2-ev3 as purely-spatial.
That displacement is $-2.4$, as you computed.

Below the same situation in the (Bob) S'-frame.

Although it's not shown below,  you can fill in the following:
from the separation event ev1,
count up 5 ticks for Bob, then count over 3 space-ticks [sticks] to the left.
You should meet the worldline of the (Alice) S-frame origin, which
occurs 4 ticks along the (Alice) S-frame origin worldline.

SYMMETRY, in accordance with the principle of relativity!


ORIGINAL:
For Event 3,
you used $_3=0,_3=5$,... which is simultaneous with $P$ in the S-frame.
But, that event is not simultaneous with $P$ in the $S'$-frame,
which would be associated with length-contraction (as a measurement in the S'-frame).
A: The two positions of the origin of S that you have determined, namely -3.75ly and -2,4ly, differ because they relate to the position of the origin of S at two different times.
The first figure, namely -3.75ly, is the position of the origin of S at time t=5yr.
The second figure, namely -2.4ly, is the position it would be at t'=4yr.
The inconsistency arises because you use the word 'when' to imply two different simultaneity conditions without realising it.
In the sentence that reads 'Now suppose if I am interested in finding out the position of origin of S in S' when B reaches P' you use the word 'when' to mean at the same time in S.
In the sentence that reads 'This means when the far end reaches ′=0 this means the other end reaches ′=−2.4' you use the word 'when' to mean at the same time in S'.
So you are actually comparing two different events.
A: You assume that, when the origins of the frames coincide, $t=t'$. This isn't rue. The right transformation is:
$$t'=\gamma (t-\frac{vx}{c^2})$$
This means that when the origins of $S$ and $S'$ coincide, the clocks in $S$ will all tell you that $t=0$, while the clocks in $S'$ will tell you something different. If you move along the $x$-axis (while keeping the origins at place) in $S$, the clocks in $S'$ will give you a time $t'\neq 0$. This means that simultaneous events in $S$ are not simultaneous in $S'$.
But I see your problem. You wrote:
$$x_3'=\gamma(x-vt)=1.25(-0.6c\times5yr)=-3.75ly$$
You have set $x=0$ and $t=5$. When you fill this in for the $t_3'$ transformation you get:
$$t_3'=\gamma(t-\frac{vx}{c^2})=6,25(year)$$
The first equation seems in contradiction with space contraction, which gives $2,4$. But note that in the case $x_3'=-3,75$ (coinciding with the origin of $S$), $x$ will be $x=3$ (coinciding with the origin of $S'$). So a length of $3,75$ in $S'$ corresponds to a length $3$ in $S$ (as a length $3$ in $S'$ corresponds to a length $2,4$ in $S$). That is, $3,75$ has contracted to $3$. You can't say that a length of $3$ has elongated to $3,75$ though, because you consider $S'$ to be the moving frame and $S$ the stationary one. If $S'$ were the stationary frame then indeed a length of $3,75$ in $S'$ would indeed have elongated in $S$ (to $\gamma\times 3,75$).
A $5(year)$ during kiss, given at the origin of $S$, seems to last $6,25(year)$ in $S'$. The clock at the origin of $S$ points to $5$, while the clock in $S'$ points to $6,25$ at $x_3'=-3,75$. That is, the kiss seems to go slower in $S'$. As it should be. A $4(year)$ during kiss give at the origin of $S'$ seems to last $5(year)$ in $S$. That is time seems to go slower in $S'$, as seen in $S$.
Very confusing! But it all works out fine.
Note one more thing. For $\frac{-2,4}{4}$ you will get the same result as $\frac{-3,75}{6,25}$, namely $-0,6$, the velocity of the frame $S$ wrt to $S'$. Likewise, you get $\frac{3}{5}=0,6$, the velocity of $S'$ wrt to $S$.
