I'm sorry for bringing you this much confusion but what I can give you is only a prescription for avoiding confusion. This topic is full of heat and very little light.
The 1st law of thermodynamics, if you really want to define it well, is that "Energy is conserved and heat is a form of energy." This wording might seem much less mathematical than the usual, but the truth is that it is incredibly ill-defined. Firstly, I will write down some suggestive notation, as much as possible agreeing with yours, but with some deliberate deviations, hopefully to help shed some light. My version of the mathematical form of the 1st Law is
$$ \mathrm d U = đ Q + đ W$$
where the đ is there to remind you that these are inexact forms and absolutely depends upon the path, and also ultimately also depends upon your choices. They are so tenuous that there is no possible way to make a sensible complete theory on top of them. In fact, that is somewhat a good reason to sweep ugliness into them, as we will shortly see.
In the standard textbooks, they do emphasise that it is important to pay attention to state functions, like extensive $S\ U\ V\ N$ and intensive $T\ P\ \mu$, because they are independent of path, evaluable as long as the system is in thermal equilibrium. Let us plot in our minds $S\ U\ V\ N$ as a hypersurface, say $S(U,V,N)$ in $\mathbb R^4$ [Think of plotting $y(x)$ in $\mathbb R^2$]. Note that this is all-encompassing: It is possible for any monatomic ideal gas system to have any combination of $U\ V\ N$ and thus this means that reversible processes can determine all thermodynamic state variables of interest. Mind you, this includes all the $A, F, H, G, \Phi,$ what have you.
This is in direct contrast to heat and work, that by simply going in a cycle, you can infinitely repeat extraction of work out of pumping heat between two thermal reservoirs of different temperatures, despite all the state variables returning to their initial values.
Now we consider a cycle that has one irreversible process that we choose to be the adiabatic free expansion. During the adiabatic free expansion, $đ Q = 0 = đ W = \mathrm d U$, and the system increases $S\ \&\ V,$ keeping $N$ and as much of everything else constant (I cannot be bothered to verify either way, but I suspect $\mu$ would change---it matters not). Note that in this crucial step, the system cannot be drawn as having a well-defined path in the space of state variables. By being fast, it will NOT have $P$ well-defined, and typically we just draw a dotted path, indicating that, really, the system jumped "off the paper" from its initial state to its final state. In the other reversible processes, we can extract heat out, and return the system of all the state variables back to its initial values. I will leave it to you to figure out if we can still consider $đ Q = đ Q_\text{rev}$ in general.
Moving on, I would like to bring your attention to an inconvenient fact. In the great textbooks, they would also tell you that the concept of heat and work are ill-defined. IIRC, Callen, Kittel & Kroemer, Feynman, at least, covered this. (Slight detour: Kittel's Intro to Solid State Physics has a rather beginner unfriendly front half, but Kittel & Kroemer wrote a rather nice Thermal Physics textbook.) The culprit here appears when you look at magnetic systems. The thermodynamic magnetic work's definition is particularly contentious, and even Wikipedia's article on the topic is woeful: In one of the prominent definitions, it integrates $ \vec H \cdot \mathrm d \vec B _e$, and this is obviously bad because neither variable is extensive. There is also no reason why it cannot be defined as the opposite, namely $ \vec B_e \cdot \mathrm d \vec H $, and so the literature is littered with confusion. One would have expected that a subtopic as important to low temperature physics, since magnetocalorific refridgeration is the only way to get to extremely low temperatures necessary to a tonne of important physics, to have sorted such convention stuff out, but alas, fights and confusion abound.
As such, I am going to want to try and avoid all these ill-defined stuff as much as possible, and suggest you do the same. In particular, only consider something as heat when you can explicitly see that some heat has been transferred between bodies in a way you can quantify, and do the same for work. Everything else, define them mathematically as much as you can, and go for precision in the concepts. Or else there will be too much confusion going on.
Oh yeah, a nice way to look at thermodynamics is that it is trying to extend the concept of conservation of energy to universal applicability and defining the concept of entropy. That is, the new thing that it brings on top of classical mechanics is really $ đ Q \overset{\text{def}}= \mathrm d U - đ W $, where we understand $U$ and have mechanical definitions of $ đ W $, namely $ đ W = - p \mathrm d V $ when it is well-defined. This way, we can deduce the new physical thing to consider, which we call heat transfer. Similarly, no physics before thermodynamics defined entropy $ S, $ so we should be introducing it as the new pet toy to study. Then you can argue that heat is ill-defined and transition totally to a mathematically nice study of entropy, and have a much more solid understanding of the subject. Both Callen and Kittel & Kroemer made some steps to doing this, but also acknowledged that traditional forms are convenient.